Esempio n. 1
0
        private void OnTriggerEnter2D(Object component)
        {
            if (component.name != "pacman")
            {
                return;
            }

            Destroy(gameObject);
            _highscore.AddScore(10);
        }
Esempio n. 2
0
        private void OnTriggerEnter2D(Object component)
        {
            if (component.name != "pacman")
            {
                return;
            }

            Destroy(gameObject);

            _highscore.AddScore(50);

            foreach (Ghost ghost in _ghosts)
            {
                if (ghost.gameObject.activeInHierarchy)
                {
                    ghost.TurnFrightened();
                }
            }
        }