Exemple #1
0
    void OnCollisionStay(Collision other)
    {
        //did the fish reach the target
        if (other.gameObject.Equals(target))
        {
            if (fishManager.RequestEat(gameObject, target))
            {
                //set the other fish to be dead so it doesnt try to do anything else
                if (target.name.StartsWith("Fish"))
                {
                    target.GetComponent <Fish>().state = State.Dead;
                }

                DoEat();
                fishManager.RequestToRemove(target, true);
            }
        }
    }