private void RingHandler(bool state) { if (_snoozeHandel != null && !_snoozeHandel.IsDone) { return; } if (state) { _ui.ToggleAlarmHint(false); _ui.ToggleAlarmBar(true); _ringHandel = new TickEvent( TickUtils.SecToTicks(_wakeUpSecs), tick => { _controller.AlarmPress -= RingHandler; _ui.ToggleAlarmBar(false); foreach (var animator in _hoomans) { animator.SetBool(Wake, true); } }, tick => { _ui.UpdateAlarmBar((float)tick / (_wakeUpSecs * 5)); }, TickEvent.Type.MICRO); } else { _ui.ToggleAlarmHint(true); _ui.ToggleAlarmBar(false); _ringHandel?.Destroy(); } }
public void Snooze(Vector3 position) { if (_snoozeHandel != null && !_snoozeHandel.IsDone) { return; } PlaySnoozeSound(); PopupText.Create(position); _ui.ToggleAlarmHint(false); _snoozeBar.transform.parent.parent.gameObject.SetActive(true); _snoozeHandel = new TickEvent( TickUtils.SecToTicks(_snoozeSecs), tick => { _snoozeBar.transform.parent.parent.gameObject.SetActive(false); if (_playerInRange) { _ui.ToggleAlarmHint(true); } }, tick => _snoozeBar.size = (float)tick / (float)_snoozeSecs); }
private void Start() { _gameOverEvent = new TickEvent(TickUtils.SecToTicks(_levelDuration), GameOver); _ui.SetHoomanCount(_hoomanCount); }
public void Show(int ticks) { _root.SetActive(true); _timeTaken.text = $"Time Taken : {TickUtils.TicksToSec(ticks)}"; }