Example #1
0
    void Setup()
    {
        scoreManager = GetComponent <ScoreManager>();
        if (scoreManager == null)
        {
            Debug.LogWarning("No score manager on game manger");
        }

        player = GameObject.FindGameObjectWithTag("Player");
        if (player == null)
        {
            throw new Exception("Error: no player was found in the scene");
        }
        else
        {
            playerDeathEvents        = player.GetComponent <DeathEvents>();
            playerPacdotPickupEvents = player.GetComponent <PacdotPickup>();
        }
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     currentDirection = Vector2.zero;
     dest             = transform.position;
     deathEvents      = gameObject.GetComponent <DeathEvents>();
 }