private void PickupBaby(BabyMovement babyMovement) { babyMovement.WasPickedUp(); gameObject.GetComponent <AudioSource> ().Play(); heldBaby = babyMovement; currentBehavior = DingoBehaviorState.LeavingWithBaby; }
public void ScareOff() { if (currentBehavior == DingoBehaviorState.LeavingWithBaby) { DropBaby(); } currentBehavior = DingoBehaviorState.RunningAway; }
private void WaitForBaby() { var baby = FindClosestBaby(); if (baby) { currentBehavior = DingoBehaviorState.TrackingBaby; TrackBaby(); } }
private void TrackBaby() { var targetBaby = FindClosestBaby(); if (targetBaby == null) { currentBehavior = DingoBehaviorState.WaitingForBaby; return; } var targetPosition = targetBaby.transform.position; var direction = (targetPosition - transform.position).normalized; Move(direction * creepSpeed * Time.deltaTime); }
public void Reset() { currentBehavior = DingoBehaviorState.TrackingBaby; transform.position = startingPoint; }