@@ -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)