Ejemplo n.º 1
0
 // Token: 0x06000803 RID: 2051 RVA: 0x00024124 File Offset: 0x00022324
 protected void ExecAfterTicks(Action action, ulong delayTickCount = 1UL)
 {
     if (this.m_delayExecList == null)
     {
         this.m_delayExecList = new LinkedList <Task.DelayExecItem>();
     }
     Task.DelayExecItem delayExecItem = new Task.DelayExecItem
     {
         m_execTargetTick = this.m_currTickCount + delayTickCount,
         m_action         = action
     };
     if (this.m_delayExecList.Count == 0 || this.m_delayExecList.Last.Value.m_execTargetTick <= delayExecItem.m_execTargetTick)
     {
         this.m_delayExecList.AddLast(delayExecItem);
     }
     else
     {
         LinkedListNode <Task.DelayExecItem> linkedListNode = this.m_delayExecList.First;
         while (linkedListNode != null && linkedListNode.Value.m_execTargetTick <= delayExecItem.m_execTargetTick)
         {
             linkedListNode = linkedListNode.Next;
         }
         if (linkedListNode != null)
         {
             this.m_delayExecList.AddBefore(linkedListNode, delayExecItem);
         }
     }
 }
Ejemplo n.º 2
0
 // Token: 0x06000802 RID: 2050 RVA: 0x00024060 File Offset: 0x00022260
 void ITickable.Tick()
 {
     this.m_currTickCount += 1UL;
     if (this.State == Task.TaskState.Stopped)
     {
         if (this.m_currTickCount % 200UL == 0UL)
         {
             global::Debug.LogError("Still ticking an stopped task: " + this);
         }
         return;
     }
     if (this.State != Task.TaskState.Running)
     {
         return;
     }
     if (this.m_delayExecList != null)
     {
         while (this.m_delayExecList.First != null)
         {
             Task.DelayExecItem value = this.m_delayExecList.First.Value;
             if (value.m_execTargetTick > this.m_currTickCount)
             {
                 break;
             }
             value.m_action();
             this.m_delayExecList.RemoveFirst();
         }
     }
     this.OnTick();
 }