private void StartTimer() { if (timerRoutine == null) { timerRoutine = StartCoroutine(isCountUp ? CountUp() : CountDown()); OnTimerStart?.Invoke(); } }
public void Start() { if (_isAwake) { return; } OnTimerStart?.Invoke(); _isAwake = true; }
public void Start() { if (_awake) { return; } _currentTime = initialTime; _awake = true; OnTimerStart?.Invoke(); }
private void SetPlayerReadyState(IPlayer player) { PlayerReadyState[player] = !PlayerReadyState[player]; if (Players.Count >= MinPlayersNeededToStart) { int readyPlayers = 0; foreach (bool val in PlayerReadyState.Values) { if (val) { readyPlayers++; } } OnTimerStart?.Invoke(new GameStartEventArgs(RoomID, MinPlayersNeededToStart, MaxPlayersNeededToStart, readyPlayers, Players.ToArray())); } }