added ability to 'soft start' and 'soft stop' a particle effect

This commit is contained in:
Josh Wilson 2006-07-25 01:43:04 +00:00
parent a886cef943
commit 4fe44aeed8

View File

@ -25,13 +25,6 @@ class ParticleEffect(NodePath):
self.addParticles(particles) self.addParticles(particles)
self.renderParent = None self.renderParent = None
def start(self, parent=None, renderParent=None):
assert self.notify.debug('start() - name: %s' % self.name)
self.renderParent = renderParent
self.enable()
if parent != None:
self.reparentTo(parent)
def cleanup(self): def cleanup(self):
self.removeNode() self.removeNode()
self.disable() self.disable()
@ -51,6 +44,13 @@ class ParticleEffect(NodePath):
self.forceGroupDict = {} self.forceGroupDict = {}
self.particlesDict = {} self.particlesDict = {}
def start(self, parent=None, renderParent=None):
assert self.notify.debug('start() - name: %s' % self.name)
self.renderParent = renderParent
self.enable()
if parent != None:
self.reparentTo(parent)
def enable(self): def enable(self):
# band-aid added for client crash - grw # band-aid added for client crash - grw
if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'): if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'):
@ -207,3 +207,11 @@ class ParticleEffect(NodePath):
def clearToInitial(self): def clearToInitial(self):
for particles in self.getParticlesList(): for particles in self.getParticlesList():
particles.clearToInitial() particles.clearToInitial()
def softStop(self):
for particles in self.getParticlesList():
particles.softStop()
def softStart(self):
for particles in self.getParticlesList():
particles.softStart()