Ejemplo n.º 1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (capacity <= harvestedFood)
        {
            return;
        }

        if (collision.transform.CompareTag("food"))
        {
            harvestedFood++;
            AgentController.EatFood(agent, collision.gameObject, agent.arena);
            agent.agentKnowledge.observedFoods.Remove(collision.gameObject);
        }
        if (collision.transform.CompareTag("badFood"))
        {
            harvestedFood++;
            AgentController.EatBadFood(agent, collision.gameObject, agent.arena);
            agent.agentKnowledge.observedFoods.Remove(collision.gameObject);
        }
    }