Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Bear bear = other.gameObject.GetComponent <Bear>();

        if (bear != null)
        {
            bear.AddMouth();
        }
    }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Bear bear = other.gameObject.GetComponent <Bear>();

        if (bear != null)
        {
            GetComponent <AudioSource>().Play();
            bear.AddMouth();
        }
    }