mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
added pre-delete event for AI DistObjs
This commit is contained in:
parent
9d9a9d40d0
commit
d7926f8735
@ -36,6 +36,11 @@ class DistributedObjectAI(DirectObject.DirectObject):
|
|||||||
# """
|
# """
|
||||||
# print ("Destructing: " + self.__class__.__name__)
|
# print ("Destructing: " + self.__class__.__name__)
|
||||||
|
|
||||||
|
def getDeleteEvent(self):
|
||||||
|
if hasattr(self, 'doId'):
|
||||||
|
return 'distObjDelete-%s' % self.doId
|
||||||
|
return None
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
"""
|
"""
|
||||||
Inheritors should redefine this to take appropriate action on delete
|
Inheritors should redefine this to take appropriate action on delete
|
||||||
@ -46,6 +51,7 @@ class DistributedObjectAI(DirectObject.DirectObject):
|
|||||||
if self.air is not None:
|
if self.air is not None:
|
||||||
# self.doId may not exist. The __dict__ syntax works around that.
|
# self.doId may not exist. The __dict__ syntax works around that.
|
||||||
assert(self.notify.debug('delete(): %s' % (self.__dict__.get("doId"))))
|
assert(self.notify.debug('delete(): %s' % (self.__dict__.get("doId"))))
|
||||||
|
|
||||||
# Clean up all the pending barriers.
|
# Clean up all the pending barriers.
|
||||||
for barrier in self.__barriers.values():
|
for barrier in self.__barriers.values():
|
||||||
barrier.cleanup()
|
barrier.cleanup()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user