public static TimeEvent Add(TimeEvent.Name timeName, Command pCommand, float deltaTimeToTrigger) { TimerManager pMan = TimerManager.pActiveMan; Debug.Assert(pMan != null); //TimeEvent pNode = (TimeEvent)pMan.BaseAdd(); TimeEvent pNode = (TimeEvent)pMan.BaseSortedAdd(deltaTimeToTrigger); Debug.Assert(pNode != null); Debug.Assert(pCommand != null); Debug.Assert(deltaTimeToTrigger >= 0.0f); pNode.Set(timeName, pCommand, deltaTimeToTrigger); return(pNode); }
public static TimeEvent Add(TimeEvent.Name EventName, Command pCommand, float deltaTime) { Debug.Assert(pCommand != null); Debug.Assert(deltaTime > 0.0f); TimerManager pMan = TimerManager.PrivGetInstance(); Debug.Assert(pMan != null); // Take a node out from Reserve list. // This node is washed in BasePopNode(). TimeEvent pNode = (TimeEvent)pMan.BasePopNode(); Debug.Assert(pNode != null); pNode.Set(EventName, pCommand, deltaTime); pMan.BaseSortedAdd(pNode); return(pNode); }