mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
*** empty log message ***
This commit is contained in:
parent
623a770f4b
commit
977ef4dfbc
@ -25,8 +25,9 @@ def getTimeFrame():
|
||||
|
||||
|
||||
class Task:
|
||||
def __init__(self, callback):
|
||||
def __init__(self, callback, priority = 0):
|
||||
self.__call__ = callback
|
||||
self.__priority__ = priority
|
||||
self.uponDeath = None
|
||||
|
||||
def setStartTimeFrame(self, startTime, startFrame):
|
||||
@ -202,7 +203,17 @@ class TaskManager:
|
||||
TaskManager.notify.debug('spawning task named: ' + name)
|
||||
task.name = name
|
||||
task.setStartTimeFrame(self.currentTime, self.currentFrame)
|
||||
self.taskList.append(task)
|
||||
# search back from the end of the list until we find a
|
||||
# task with a lower priority, or we hit the start of the list
|
||||
index = len(self.taskList) - 1
|
||||
while (1):
|
||||
if (index < 0):
|
||||
break
|
||||
if (self.taskList[index].__priority__ <= task.__priority__):
|
||||
break
|
||||
index = index - 1
|
||||
index = index + 1
|
||||
self.taskList.insert(index, task)
|
||||
return task
|
||||
|
||||
def doMethodLater(self, delayTime, func, taskName):
|
||||
|
Loading…
x
Reference in New Issue
Block a user