public override void RunFixedUpdate() { if (ANIMATION_DATA.AnimationNameMatches) { if (!MOVEMENT_DATA.IsGrounded) { characterStateController.ChangeState((int)AxeEnemyState.AxeFallingIdle); } if (!AI_CONTROL.PlayerIsDead()) { MOVEMENT_DATA.Turn = move.GetTurn(); move.MoveForward(MOVEMENT_DATA.WalkSpeed, MOVEMENT_DATA.Turn); } else { characterStateController.ChangeState((int)AxeEnemyState.AxeIdle); } } else { MOVEMENT_DATA.Turn = move.GetTurn(); move.MoveForward(MOVEMENT_DATA.WalkSpeed * 0.7f, MOVEMENT_DATA.Turn); } }
public override void RunFixedUpdate() { if (ANIMATION_DATA.AnimationNameMatches) { //Debug.Log("jump force: " + AI_CONTROL.GetRequiredJumpForce().ToString()); jump.JumpUp(AI_CONTROL.GetRequiredJumpForce(), false); } }
bool ChasePlayer() { if (AI_CONTROL.GetLastPlayerWayPoint() != null) { if (AI_CONTROL.PlayerIsClose(20f)) { if (!AI_CONTROL.PlayerIsDead()) { return(true); } } } return(false); }
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; } } } }
bool IsPastWayPoint() { if (CONTROL_MECHANISM.IsFacingForward()) { if (CONTROL_MECHANISM.transform.position.x > AI_CONTROL.GetNextWayPoint().transform.position.x) { return(true); } } else { if (CONTROL_MECHANISM.transform.position.x < AI_CONTROL.GetNextWayPoint().transform.position.x) { return(true); } } return(false); }
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; } } }
public override void RunFrameUpdate() { if (UpdateAnimation()) { if (ANIMATION_DATA.PlayTime > jump.JumpTime + 0.5f) { if (MOVEMENT_DATA.IsGrounded) { characterStateController.ChangeState((int)AxeEnemyState.AxeFallingToLanding); return; } if (AI_CONTROL.transform.position.y > AI_CONTROL.GetNextWayPoint().transform.position.y) { if (!IsPastWayPoint()) { move.MoveForward(MOVEMENT_DATA.WalkSpeed * AI_CONTROL.GetNextWayPoint().AirWalkSpeedMultiplier, CHARACTER_TRANSFORM.rotation.eulerAngles.y); } } } } }