mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
added ability to 'soft start' and 'soft stop' a particle effect
This commit is contained in:
parent
a886cef943
commit
4fe44aeed8
@ -25,13 +25,6 @@ class ParticleEffect(NodePath):
|
||||
self.addParticles(particles)
|
||||
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):
|
||||
self.removeNode()
|
||||
self.disable()
|
||||
@ -51,6 +44,13 @@ class ParticleEffect(NodePath):
|
||||
self.forceGroupDict = {}
|
||||
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):
|
||||
# band-aid added for client crash - grw
|
||||
if hasattr(self, 'forceGroupDict') and hasattr(self, 'particlesDict'):
|
||||
@ -72,7 +72,7 @@ class ParticleEffect(NodePath):
|
||||
for p in self.particlesDict.values():
|
||||
p.disable()
|
||||
self.fEnabled = 0
|
||||
|
||||
|
||||
def isEnabled(self):
|
||||
"""
|
||||
Note: this may be misleading if enable(), disable() not used
|
||||
@ -207,3 +207,11 @@ class ParticleEffect(NodePath):
|
||||
def clearToInitial(self):
|
||||
for particles in self.getParticlesList():
|
||||
particles.clearToInitial()
|
||||
|
||||
def softStop(self):
|
||||
for particles in self.getParticlesList():
|
||||
particles.softStop()
|
||||
|
||||
def softStart(self):
|
||||
for particles in self.getParticlesList():
|
||||
particles.softStart()
|
||||
|
Loading…
x
Reference in New Issue
Block a user