Пример #1
0
        public new void Construct(IScoreManager scoreManager)
        {
            _scoreManager = scoreManager;
            _scoreManager.ScoreChanged += OnScoreChanged;

            _text.text = _scoreManager.GetScore().ToString();
        }
Пример #2
0
    public void GameOver()
    {
        if (CurrenteStateName == GridStates.GameOver)
        {
            return;
        }

        if (_highScoreManager != null)
        {
            _highScoreManager.SetHighScore(_scoreManager.GetScore());
            DisplayGameOverMessage();
        }

        SetState(GridStates.GameOver);
        UnsubscribeInputEvents();

        if (OnGameOverEvent != null)
        {
            OnGameOverEvent(this);
        }
    }