From 135b484657935441f84380c8cd3805c96e44915f Mon Sep 17 00:00:00 2001 From: Abhishek Nath Date: Thu, 3 Jun 2010 03:01:45 +0000 Subject: [PATCH] Add missing libarary import and add a function to cleanup properly --- direct/src/showbase/Audio3DManager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/direct/src/showbase/Audio3DManager.py b/direct/src/showbase/Audio3DManager.py index 5ffa2e85fa..04fe174e03 100644 --- a/direct/src/showbase/Audio3DManager.py +++ b/direct/src/showbase/Audio3DManager.py @@ -2,7 +2,7 @@ __all__ = ['Audio3DManager'] -from pandac.PandaModules import VBase3 +from pandac.PandaModules import Vec3, VBase3 from direct.task import Task # class Audio3DManager: @@ -272,3 +272,14 @@ class Audio3DManager: else: self.audio_manager.audio3dSetListenerAttributes(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1) return Task.cont + + def disable(self): + """ + Detaches any existing sounds and removes the update task + """ + taskMgr.remove("Audio3DManager-updateTask") + self.detachListener() + for object in self.sound_dict.keys(): + for sound in self.sound_dict[object]: + self.detachSound(sound) +