Exemplo n.º 1
0
        public void AddScore(Score score, IWhackable whackable)
        {
            totalScore = new Score(totalScore.value + score.value);
            ShowScore(score, whackable);

            ScoreUpdatedEvent?.Invoke(totalScore.value);
        }
Exemplo n.º 2
0
    private void UpdateScoreDisplay(ScoreUpdatedEvent obj)
    {
        _scoreText.text      = obj.Score.ToString();
        _addedScoreText.text = obj.NewPoints.ToString();

        if (obj.NewPoints > 0)
        {
            _addedScoreAnimator.SetTrigger("Added");
        }
        else if (obj.NewPoints < 0)
        {
            _addedScoreAnimator.SetTrigger("Removed");
        }
    }
Exemplo n.º 3
0
 public void ResetScore()
 {
     totalScore = new Score(0);
     ScoreUpdatedEvent?.Invoke(totalScore.value);
     NewHighscoreSet = false;
 }
Exemplo n.º 4
0
 public static void PublishScoreUpdatedEvent(ScoreKeeper scoreKeeper)
 {
     ScoreUpdatedEvent?.Invoke(scoreKeeper);
     Instance.EmitSignal(nameof(ScoreUpdated), scoreKeeper);
 }