Exemplo n.º 1
0
    private void Update()
    {
        int count = this._Scheduler.Count;

        for (int i = 0; i < count; i++)
        {
            CallBackScheduler.CallBackSchedule callBackSchedule = this._Scheduler.Dequeue();
            if (callBackSchedule.IsAction(DateTime.Now.Ticks / 10000L))
            {
                callBackSchedule.Action();
            }
            else
            {
                this._Scheduler.Enqueue(callBackSchedule);
            }
        }
        if (this._Scheduler.Count <= 0)
        {
            base.gameObject.SetActive(false);
        }
    }
Exemplo n.º 2
0
 public void RegFunc(long millisecond, Action func)
 {
     CallBackScheduler.CallBackSchedule item = new CallBackScheduler.CallBackSchedule(DateTime.Now.Ticks / 10000L, millisecond, func);
     this._Scheduler.Enqueue(item);
     base.gameObject.SetActive(true);
 }