Add missing libarary import and add a function to cleanup properly

This commit is contained in:
Abhishek Nath 2010-06-03 03:01:45 +00:00
parent cd33f54950
commit 135b484657

View File

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