Exemple #1
0
        private void OnClicked()
        {
            _currentScore++;
            _clickerGameView.ShowScore(_currentScore);

            Click?.Invoke();
            ChangeScore?.Invoke(_currentScore);
        }
Exemple #2
0
 public void TakeDamage(float damage)
 {
     _health -= damage;
     OnPlayerHealthChangedEvent?.Invoke(_health / _maxHealth);
     if (_health <= 0)
     {
         Died?.Invoke(gameObject);
         ChangeScore?.Invoke();
     }
 }
Exemple #3
0
 public void SetScore(float score)
 {
     if (score >= 0)
     {
         _currentScore = score;
         ChangeScore?.Invoke(_currentScore);
     }
     else
     {
         new System.Exception("Score cannot be less zero");
     }
 }
Exemple #4
0
 public void ChangeScoreAction(int value)
 {
     ChangeScore?.Invoke(value);
 }