Exemple #1
0
        void Init_DieState()
        {
            NPCStateNode state = (NPCStateNode)behaviorStateMachine.GetState((int)BehaviorState.Die);

            state.OnEnterDelegate += delegate()
            {
            };
            state.OnExitDelegate += delegate()
            {
            };
            state.OnUpdateDelegate += delegate()
            {
            };
        }
Exemple #2
0
        void Init_AttackState()
        {
            NPCStateNode state = (NPCStateNode)behaviorStateMachine.GetState((int)BehaviorState.Attack);

            state.OnEnterDelegate += delegate()
            {
                Debug.Log("Entering Attack");
                myShoot.StartAttackAnimation();
            };
            state.OnExitDelegate += delegate()
            {
                Debug.Log("Exiting Attack");
            };
            state.OnUpdateDelegate += delegate()
            {
            };
        }
Exemple #3
0
        void Init_DamageState()
        {
            NPCStateNode state = (NPCStateNode)behaviorStateMachine.GetState((int)BehaviorState.Damaged);

            // Add a text message to the OnEnter and OnExit delegates.
            state.OnEnterDelegate += delegate()
            {
                Debug.Log("OnEnter - DAMAGE");
            };
            state.OnExitDelegate += delegate()
            {
                Debug.Log("OnExit - DAMAGE");
            };

            state.OnUpdateDelegate += delegate()
            {
            };
        }
Exemple #4
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();
            };
        }