mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
Possible crash fix
This commit is contained in:
parent
d597e25e60
commit
7a498feefd
1 changed files with 26 additions and 0 deletions
26
toontown/hood/SleepingHydrantAnimatedProp.py
Normal file
26
toontown/hood/SleepingHydrantAnimatedProp.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import AnimatedProp
|
||||||
|
from direct.interval.IntervalGlobal import *
|
||||||
|
from direct.task import Task
|
||||||
|
import math
|
||||||
|
|
||||||
|
class SleepingHydrantAnimatedProp(AnimatedProp.AnimatedProp):
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
AnimatedProp.AnimatedProp.__init__(self, node)
|
||||||
|
self.task = None
|
||||||
|
return
|
||||||
|
|
||||||
|
def bobTask(self, task):
|
||||||
|
self.node.setSz(1.0 + 0.08 * math.sin(task.time))
|
||||||
|
return Task.cont
|
||||||
|
|
||||||
|
def enter(self):
|
||||||
|
AnimatedProp.AnimatedProp.enter(self)
|
||||||
|
self.task = taskMgr.add(self.bobTask, self.uniqueName('bobTask'))
|
||||||
|
|
||||||
|
def exit(self):
|
||||||
|
AnimatedProp.AnimatedProp.exit(self)
|
||||||
|
if self.task:
|
||||||
|
taskMgr.remove(self.task)
|
||||||
|
self.task = None
|
||||||
|
return
|
Loading…
Reference in a new issue