public void Call() { isSniffing = false; if (currentAction != null && currentAction.GetImportance() == DogAction.Importance.HIGH) { savedAction = currentAction; } else if (currentAction != null && currentAction.ToString() == "Sit") { animator.SetTrigger("StandUp"); } if (characterMovement.CutsceneLock) { ai.StartAction(new Call(this, player, true)); } else { ai.StartAction(new Call(this, player)); } }
void Update() { if (savedAction != null) { Debug.Log("saved action " + savedAction.ToString()); } Debug.DrawLine(transform.position, transform.position + transform.forward * 3, Color.yellow); if (itemHand != null && itemHand.GetItemInHand() != null && itemHand.GetItemInHand().name == "Stick") { if (currentAction != null && currentAction.GetImportance() == DogAction.Importance.HIGH) { savedAction = currentAction; } if (Vector3.Distance(transform.position, player.position) < 3) { if (!isWaitingForFetch) { ai.StartAction(new WaitForFetch(this, player)); } } else { ai.StartAction(new FollowPlayer(this, player)); } } if (currentAction != null) { currentAction.UpdateAction(); } else if (savedAction != null) { currentAction = savedAction; currentAction.StartAction(); savedAction = null; } }