Просмотр исходного кода

AmbientSound plays on creation, can move it in the editor

Darren Ranalli 22 лет назад
Родитель
Сommit
1b04e361d6
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 0
      direct/src/level/AmbientSound.py
  2. 1 1
      direct/src/level/EntityTypes.py

+ 2 - 0
direct/src/level/AmbientSound.py

@@ -4,8 +4,10 @@ import BasicEntities
 class AmbientSound(BasicEntities.NodePathEntity):
     def __init__(self, level, entId):
         BasicEntities.NodePathEntity.__init__(self, level, entId)
+        self.initSound()
 
     def destroy(self):
+        self.destroySound()
         BasicEntities.NodePathEntity.destroy(self)
 
     def initSound(self):

+ 1 - 1
direct/src/level/EntityTypes.py

@@ -119,7 +119,7 @@ class VisibilityExtender(Entity):
         ('newZones', [], 'visZoneList'),
         )
 
-class AmbientSound(Entity):
+class AmbientSound(Nodepath):
     type = 'ambientSound'
     attribs = (
         ('soundPath', '', 'bamfilename'),