public override void RunFrameUpdate()
        {
            if (UpdateAnimation())
            {
                if (findPlayer.TriggerAttack())
                {
                    characterStateController.ChangeState((int)AxeEnemyState.AxeAttackDownward);
                    return;
                }

                if (ChasePlayer())
                {
                    if (AI_CONTROL.TargetPath.Count == 0)
                    {
                        AI_CONTROL.FindPathToPlayer();
                    }

                    //AI_CONTROL.UpdateStartPath ();
                    AI_CONTROL.InitStartPath();
                    AI_CONTROL.UpdatePathStatus();

                    switch (AI_CONTROL.GetPathFindMethod())
                    {
                    case PathFindMethod.NONE:
                        if (!AI_CONTROL.IsFacingPlayer())
                        {
                            characterStateController.ChangeState((int)AxeEnemyState.StandingTurnToRight90);
                        }
                        return;

                    case PathFindMethod.WALK:
                        characterStateController.ChangeState((int)AxeEnemyState.AxeWalkForward);
                        return;

                    case PathFindMethod.TURN:
                        characterStateController.ChangeState((int)AxeEnemyState.StandingTurnToRight90);
                        return;

                    case PathFindMethod.JUMP:
                        characterStateController.ChangeState((int)AxeEnemyState.AxeJumpingUp);
                        return;
                    }
                }
            }
        }
Beispiel #2
0
        public override void RunFrameUpdate()
        {
            if (UpdateAnimation())
            {
                if (findPlayer.TriggerAttack())
                {
                    characterStateController.ChangeState((int)AxeEnemyState.AxeAttackDownward);
                    return;
                }

                if (AI_CONTROL.PathUpdateCount >= 5)
                {
                    AI_CONTROL.FindPathToPlayer();
                    AI_CONTROL.PathUpdateCount = 0;
                }

                AI_CONTROL.UpdatePathStatus();

                if (AI_CONTROL.TargetPath.Count == 0)
                {
                    characterStateController.ChangeState((int)AxeEnemyState.AxeIdle);
                    return;
                }

                switch (AI_CONTROL.GetPathFindMethod())
                {
                case PathFindMethod.NONE:
                    return;

                case PathFindMethod.WALK:
                    return;

                case PathFindMethod.TURN:
                    characterStateController.ChangeState((int)AxeEnemyState.StandingTurnToRight90);
                    return;

                case PathFindMethod.JUMP:
                    characterStateController.ChangeState((int)AxeEnemyState.AxeJumpingUp);
                    return;
                }
            }
        }