예제 #1
0
파일: NPC.cs 프로젝트: Kevin-Beck/BulletRPG
 private void Awake()
 {
     animator        = GetComponentInChildren <Animator>();
     navAgent        = GetComponent <NavMeshAgent>();
     myHealth        = GetComponent <NPCHealth>();
     myMove          = GetComponent <INPCMove>();
     myShoot         = GetComponent <INPCShoot>();
     baseStats       = GetComponentInChildren <CharacterStats>();
     playerTransform = Utilities.GetPlayerTransform();
 }
예제 #2
0
파일: NPC.cs 프로젝트: Kevin-Beck/BulletRPG
        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();
            };
        }