public void Execute() { timer = Mathf.Min(timer + Time.deltaTime, finishTime); if (timer < finishTime) { return; } timer = 0.0f; IsRunning = false; ManagerUpdate.RemoveFrom(this); callBack(); }
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); }
public void Dispose() { ManagerUpdate.RemoveFrom(this); callBack = delegate { }; }
public void Setup(ManagerUpdate mng) { this.mng = mng; }