private void Awake() { animator = GetComponentInChildren <Animator>(); navAgent = GetComponent <NavMeshAgent>(); myHealth = GetComponent <NPCHealth>(); myMove = GetComponent <INPCMove>(); myShoot = GetComponent <INPCShoot>(); baseStats = GetComponentInChildren <CharacterStats>(); playerTransform = Utilities.GetPlayerTransform(); }
void Init_MoveState(INPCMove movement) { NPCStateNode state = (NPCStateNode)behaviorStateMachine.GetState((int)BehaviorState.Move); // Add a text message to the OnEnter and OnExit delegates. state.OnEnterDelegate += delegate() { Debug.Log("Entering Moving"); animator.SetBool("moving", true); }; state.OnExitDelegate += delegate() { Debug.Log("Exiting Moving"); myMove.Stop(); }; state.OnUpdateDelegate += delegate() { myMove.Move(); }; }