Ejemplo n.º 1
0
 private void StartTimer()
 {
     if (timerRoutine == null)
     {
         timerRoutine = StartCoroutine(isCountUp ? CountUp() : CountDown());
         OnTimerStart?.Invoke();
     }
 }
Ejemplo n.º 2
0
 public void Start()
 {
     if (_isAwake)
     {
         return;
     }
     OnTimerStart?.Invoke();
     _isAwake = true;
 }
Ejemplo n.º 3
0
 public void Start()
 {
     if (_awake)
     {
         return;
     }
     _currentTime = initialTime;
     _awake       = true;
     OnTimerStart?.Invoke();
 }
Ejemplo n.º 4
0
        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()));
            }
        }