Ejemplo n.º 1
0
    void OnTriggerExit2D(Collider2D other)
    {
        if (other.name.Equals("Boundary"))
        {
            moveToRandom();
        }

        else if (this.gameObject.name.Equals("plane") & other.tag.Equals("sup"))
        {
            animatorCrate.SetTrigger("flashTrig");
            planeGC.supplyAmount++;
            GameObject s = Instantiate(yaySound);
            Destroy(other.gameObject);
            Destroy(s, 1f);
        }
        else if (this.gameObject.name.Equals("plane") & other.tag.Equals("heart"))
        {
            animatorHealth.SetTrigger("flashTrig");
            planeGC.buyHealth();
            GameObject s = Instantiate(yaySound);
            Destroy(other.gameObject);
            Destroy(s, 1f);
        }
    }