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

            Destroy(gameObject);
            _highscore.AddScore(10);
        }
Ejemplo 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();
                }
            }
        }