Пример #1
0
    void SetupNearestBushAsTarget()
    {
        Bush nearestBush = VegetationGenerator.instance.GetReadyToInteractNearestBushWithFood(transform.position);

        if (!nearestBush)
        {
            return;
        }

        interactionTarget = nearestBush.GetComponent <InteractionTarget>();
        interactionTarget.AddAnimal(this);
        targetPos = interactionTarget.transform.position;
    }
Пример #2
0
    void SetupNearestTreeAsTarget()
    {
        Tree nearestTree = VegetationGenerator.instance.GetReadyToInteractNearestTree(transform.position);

        if (!nearestTree)
        {
            return;
        }

        interactionTarget = nearestTree.GetComponent <InteractionTarget>();
        interactionTarget.AddAnimal(this);
        targetPos = interactionTarget.transform.position;
    }