public void AddScore(Score score, IWhackable whackable) { totalScore = new Score(totalScore.value + score.value); ShowScore(score, whackable); ScoreUpdatedEvent?.Invoke(totalScore.value); }
private void OnTap(Vector2 screenPosition) { IWhackable whackable = GetWhackable(screenPosition); if (whackable == null) { return; } Score score = whackable.Hit(); scoreController.AddScore(score, whackable); }
private void ShowScore(Score score, IWhackable whackable) { ScoreView scoreView = Instantiate(scoreViewPrefab); scoreView.Play(score, whackable.Position); }