Beispiel #1
0
 private void Awake()
 {
     animator        = GetComponentInChildren <Animator>();
     navAgent        = GetComponent <NavMeshAgent>();
     myHealth        = GetComponent <NPCHealth>();
     myMove          = GetComponent <INPCMove>();
     myShoot         = GetComponent <INPCShoot>();
     baseStats       = GetComponentInChildren <CharacterStats>();
     playerTransform = Utilities.GetPlayerTransform();
 }
Beispiel #2
0
        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();
            };
        }