Exemple #1
0
 public void Execute()
 {
     timer = Mathf.Min(timer + Time.deltaTime, finishTime);
     if (timer < finishTime)
     {
         return;
     }
     timer     = 0.0f;
     IsRunning = false;
     ManagerUpdate.RemoveFrom(this);
     callBack();
 }
Exemple #2
0
        public void Restart(Action callBack = null, float finishTime = 0.0f)
        {
            if (finishTime > 0)
            {
                this.finishTime = finishTime;
            }

            if (callBack != null)
            {
                this.callBack = callBack;
            }

            if (timer > 0)
            {
                timer     = 0.0f;
                IsRunning = true;
                return;
            }

            timer     = 0.0f;
            IsRunning = true;

            ManagerUpdate.AddTo(this);
        }
Exemple #3
0
 public void Dispose()
 {
     ManagerUpdate.RemoveFrom(this);
     callBack = delegate { };
 }
Exemple #4
0
 public void Setup(ManagerUpdate mng)
 {
     this.mng = mng;
 }