void SetupNearestBushAsTarget() { Bush nearestBush = VegetationGenerator.instance.GetReadyToInteractNearestBushWithFood(transform.position); if (!nearestBush) { return; } interactionTarget = nearestBush.GetComponent <InteractionTarget>(); interactionTarget.AddAnimal(this); targetPos = interactionTarget.transform.position; }
void SetupNearestTreeAsTarget() { Tree nearestTree = VegetationGenerator.instance.GetReadyToInteractNearestTree(transform.position); if (!nearestTree) { return; } interactionTarget = nearestTree.GetComponent <InteractionTarget>(); interactionTarget.AddAnimal(this); targetPos = interactionTarget.transform.position; }