mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
task: Fix missing taskMgr
reference when using managed tasks
This commit is contained in:
parent
29c25a541c
commit
c24a15ed40
@ -44,14 +44,16 @@ class DirectObject:
|
||||
|
||||
#This function must be used if you want a managed task
|
||||
def addTask(self, *args, **kwargs):
|
||||
if(not hasattr(self,"_taskList")):
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
if not hasattr(self, "_taskList"):
|
||||
self._taskList = {}
|
||||
kwargs['owner'] = self
|
||||
task = taskMgr.add(*args, **kwargs)
|
||||
return task
|
||||
|
||||
def doMethodLater(self, *args, **kwargs):
|
||||
if(not hasattr(self,"_taskList")):
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
if not hasattr(self, "_taskList"):
|
||||
self._taskList = {}
|
||||
kwargs['owner'] = self
|
||||
task = taskMgr.doMethodLater(*args, **kwargs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user