Beispiel #1
0
 private void Start()
 {
     updateTimerText = FindObjectOfType <UpdateTimerText>();
     audioManager    = FindObjectOfType <AudioManager>();
     actualTime      = seconds + (minutes * 60);
     Debug.Log("Actual time:" + actualTime);
 }
Beispiel #2
0
        public void Reset()
        {
            if (_timer == null)
            {
                return;
            }

            _start = DateTime.Now;
            _end   = _start;
            _extra = TimeSpan.Zero;
            UpdateTimerText?.Invoke();
        }
Beispiel #3
0
        public void Stop()
        {
            if (NoRunningTimer)
            {
                return;
            }

            _end = DateTime.Now;
            _timer?.Stop();
            _extra += _end - _start;
            _start  = _end;
            UpdateTimerText?.Invoke();
        }
Beispiel #4
0
 private void OnTimerOnTick(object sender, EventArgs args) => UpdateTimerText?.Invoke();