Ejemplo n.º 1
0
    void OnTriggerEnter(Collider c)
    {
        if(c != null){

            manager = c.gameObject.GetComponent<Player>().manager;

            if(gameObject != null && manager != null){

                string name = c.transform.name;
                if(name.Contains("Player")){
                    manager.CollectFood(gameObject);
                }
            }

        }
    }