public void Tick(bool buttonSign) { DelayTimer.Tick(); ExtendTimer.Tick(); curState = buttonSign; OnPressed = (curState && !lastState); IsPressing = curState; OnReleased = (!curState && lastState); lastState = curState; if (OnPressed) { DelayTimer.Go(); } if (OnReleased) { ExtendTimer.Go(); } IsDelaying = DelayTimer.TimerState == MyTimer.State.RUN; IsExtending = ExtendTimer.TimerState == MyTimer.State.RUN; }
private void StartTimer(MyTimer timer, float duration) { timer.duration = duration; timer.Go(); }
private void StartTimer(MyTimer _timer, float _duration) { _timer.duration = _duration; _timer.Go(); }
void StartTimer(MyTimer myTimer, float duration) { myTimer.duration = duration; myTimer.Go(); }
private void OnEnable() { timer.Go(); }