Exemplo n.º 1
0
        public void StopTurnTimer()
        {
            TurnTimer timer = GetCurrentPlayerTurnTimer();

            if (timer != null)
            {
                timer.StopTimer();
            }
            else
            {
                Debug.LogError("GameController.StopTurnTimer: timer is null!");
            }
        }
Exemplo n.º 2
0
        private TurnTimer GetCurrentPlayerTurnTimer()
        {
            Transform currentPlayerTransform = PlayersParent.transform.Find("Player" + CurrentPlayerIndex);

            if (currentPlayerTransform == null)
            {
                return(null);
            }

            Transform timerTransform = currentPlayerTransform.Find("TurnTimer");

            if (timerTransform == null)
            {
                return(null);
            }

            TurnTimer timer = timerTransform.gameObject.GetComponent <TurnTimer>();

            return(timer);
        }