void SetupNearestBushAsTarget() { Bush nearestBush = VegetationGenerator.instance.GetReadyToInteractNearestBushWithFood(transform.position); if (!nearestBush) { return; } interactionTarget = nearestBush.GetComponent <InteractionTarget>(); interactionTarget.AddAnimal(this); targetPos = interactionTarget.transform.position; }
public void OnEnable() { bush = (Bush)target; bush.SpriteRenderer = bush.GetComponent <SpriteRenderer>(); bush.ChangeBranchLength(state); }