void OnTriggerEnter2D(Collider2D other)
    {
        Bear bear = other.gameObject.GetComponent <Bear>();

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

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