*** empty log message ***
This commit is contained in:
parent
e43b9badc3
commit
f04032ef83
|
|
@ -3,7 +3,7 @@
|
|||
from PandaModules import *
|
||||
from Interval import *
|
||||
|
||||
import BattleParticles
|
||||
import ParticleEffect
|
||||
|
||||
class ParticleInterval(Interval):
|
||||
# Name counter
|
||||
|
|
@ -43,19 +43,20 @@ class ParticleInterval(Interval):
|
|||
# Update particle effect based on current time
|
||||
if (t >= self.getDuration()):
|
||||
# If duration reached or stop event received, stop particle effect
|
||||
BattleParticles.cleanupParticleEffect(self.particleEffect)
|
||||
ParticleEffect.cleanupParticleEffect(self.particleEffect)
|
||||
self.ignore(self.stopEvent)
|
||||
self.cleanedUp = 1
|
||||
elif (event == IVAL_INIT):
|
||||
# IVAL_INIT event, start new particle effect
|
||||
BattleParticles.startParticleEffect(self.particleEffect,
|
||||
ParticleEffect.startParticleEffect(self.particleEffect,
|
||||
self.parent, self.worldRelative)
|
||||
# Accept event to kill particle effect
|
||||
self.acceptOnce(self.stopEvent,
|
||||
lambda s = self:
|
||||
BattleParticles.cleanupParticleEffect(s.particleEffect))
|
||||
ParticleEffect.cleanupParticleEffect(s.particleEffect))
|
||||
# Print debug information
|
||||
assert(self.notify.debug('updateFunc() - %s: t = %f' % (self.name, t)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,25 @@ import Particles
|
|||
import ForceGroup
|
||||
import DirectNotifyGlobal
|
||||
|
||||
|
||||
# NOTE: these two calls were moved here from BattleParticles
|
||||
# to avoid DIRECT depending on TOONTOWN! - gregw
|
||||
def startParticleEffect(effect, parent, worldRelative=1):
|
||||
assert(effect != None and parent != None)
|
||||
#notify.debug('startParticleEffect() - name: %s' % effect.getName())
|
||||
particles = effect.getParticlesNamed('particles-1')
|
||||
if (worldRelative == 1):
|
||||
particles.setRenderParent(render.node())
|
||||
effect.enable()
|
||||
effect.reparentTo(parent)
|
||||
|
||||
def cleanupParticleEffect(effect):
|
||||
assert(effect != None)
|
||||
#notify.debug('cleanupParticleEffect() - %s' % effect.getName())
|
||||
effect.disable()
|
||||
effect.reparentTo(hidden)
|
||||
effect.cleanup()
|
||||
|
||||
class ParticleEffect(NodePath):
|
||||
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffect')
|
||||
|
|
@ -204,4 +223,3 @@ class ParticleEffect(NodePath):
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue