Пример #1
0
    private void Inform(Transform food)
    {
        //print("food informed");

        LayerMask targets = ai.ownMask;

        Collider[] hits;
        int        hitCount = AnimalAI.GetColliders(transform.position, vision, targets, out hits);

        for (var i = 0; i < hitCount; i++)
        {
            if (AnimalManager.Instance.animals.ContainsKey(hits[i].gameObject.GetInstanceID()))
            {
                AnimalManager.Instance.animals[hits[i].gameObject.GetInstanceID()].
                OnCaseChanged(new CaseChangedEventArgs(new HungerCaseData(food), Case.HUNGER));
            }
        }
    }