示例#1
0
        public void AddScore(Score score, IWhackable whackable)
        {
            totalScore = new Score(totalScore.value + score.value);
            ShowScore(score, whackable);

            ScoreUpdatedEvent?.Invoke(totalScore.value);
        }
示例#2
0
        private void OnTap(Vector2 screenPosition)
        {
            IWhackable whackable = GetWhackable(screenPosition);

            if (whackable == null)
            {
                return;
            }

            Score score = whackable.Hit();

            scoreController.AddScore(score, whackable);
        }
示例#3
0
        private void ShowScore(Score score, IWhackable whackable)
        {
            ScoreView scoreView = Instantiate(scoreViewPrefab);

            scoreView.Play(score, whackable.Position);
        }