コード例 #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
 public void OnEnable()
 {
     bush = (Bush)target;
     bush.SpriteRenderer = bush.GetComponent <SpriteRenderer>();
     bush.ChangeBranchLength(state);
 }