Esempio n. 1
0
    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;
    }
Esempio n. 2
0
 private void StartTimer(MyTimer timer, float duration)
 {
     timer.duration = duration;
     timer.Go();
 }
Esempio n. 3
0
 private void StartTimer(MyTimer _timer, float _duration)
 {
     _timer.duration = _duration;
     _timer.Go();
 }
Esempio n. 4
0
 void StartTimer(MyTimer myTimer, float duration)
 {
     myTimer.duration = duration;
     myTimer.Go();
 }
Esempio n. 5
0
 private void OnEnable()
 {
     timer.Go();
 }