Пример #1
0
    public override void OnCollisionEnter(Collision c)
    {
        IEatable eatable = c.collider.GetComponentInParent(typeof(IEatable)) as IEatable;

        if (eatable != null)
        {
            mAnimator.SetTrigger("Bite");
            eatable.BeEaten(this);
        }
        else
        {
            base.OnCollisionEnter(c);
        }
    }