Beispiel #1
0
        public bool OnGoalScored()
        {
            if (!IsGameReady || IsGameOver)
            {
                return(false);
            }

            GoalScoredEvent?.Invoke(this, null);

            Debug.Log("Goooooaaaalllll!");

            _score++;

            if (null != GameUIManager.Instance.GameGameUI)
            {
                GameUIManager.Instance.GameGameUI.PlayerHUD.UpdateScore(_score);
            }

            if (_goal > 0 && _score >= _goal)
            {
                Debug.Log("You win this round!");
                RoundWonEvent?.Invoke(this, null);
                return(true);
            }

            return(true);
        }
 public void Handle(GoalScoredEvent message)
 {
     Refresh();
 }
 public void Handle(GoalScoredEvent message)
 {
     UpdateSnapshot(message.PartionKey);
 }