void PatrolStateCheck() { switch (patrolState) { case PatrolState.PatrolRight: if (!stateMachine.WallRight() && stateMachine.EdgeRight()) { horizontalDirection = 1; } else { patrolState = PatrolState.PatrolLeft; } break; case PatrolState.PatrolLeft: if (!stateMachine.WallLeft() && stateMachine.EdgeLeft()) { horizontalDirection = -1; } else { patrolState = PatrolState.PatrolRight; } break; } }
protected void FlipTheSprite() { if (playerRb2D.velocity.x < -0.001 || (stateMachine.Airborne() && stateMachine.WallRight())) { mySpriteRenderer.flipX = true; } if (playerRb2D.velocity.x > 0 || (stateMachine.Airborne() && stateMachine.WallLeft())) { mySpriteRenderer.flipX = false; } }
void FixedUpdate() { if (stateMachine.Grounded()) { dash.ResetDash(); } else if (stateMachine.Airborne()) { dash.Dash(controller.MoveHorizontal(), controller.MoveVertical(), controller.Dash()); if (stateMachine.WallLeft()) { dash.ResetDash(); } if (stateMachine.WallRight()) { dash.ResetDash(); } } }
void FixedUpdate() { if (stateMachine.Grounded()) { move.Grounded(controller.MoveHorizontal(), controller.Sprint()); } else if (stateMachine.Airborne()) { move.Airborne(controller.MoveHorizontal(), controller.Sprint()); if (stateMachine.WallLeft()) { move.Wallride(controller.MoveHorizontal(), controller.Sprint()); } if (stateMachine.WallRight()) { move.Wallride(controller.MoveHorizontal(), controller.Sprint()); } } }
void FixedUpdate() { if (stateMachine.Grounded()) { attack.GroundedAttack(controller.Attack(), lockedShooting, controller.MoveHorizontal(), controller.MoveVertical()); } else if (stateMachine.Airborne()) { if (stateMachine.WallLeft()) { attack.WallAttackLeft(controller.Attack(), lockedShooting); } else if (stateMachine.WallRight()) { attack.WallAttackRight(controller.Attack(), lockedShooting); } else { attack.AirborneAttack(controller.Attack(), lockedShooting, controller.MoveHorizontal(), controller.MoveVertical()); } } }
void FixedUpdate() { jump.SetContinousJump(controller.Jump(), controller.EndJump()); timeControll.SlowReverse(controller.SlowReverse()); timeControll.FlashReverse(controller.FlashReverse()); if (stateMachine.Grounded()) { attack.GroundedAttack(controller.Attack(), lockedShooting, controller.MoveHorizontal(), controller.MoveVertical()); dash.ResetDash(); jump.Grounded(controller.Jump(), controller.Sprint()); move.Grounded(controller.MoveHorizontal(), controller.Sprint()); } else if (stateMachine.Airborne()) { if (stateMachine.WallLeft()) { attack.WallAttackLeft(controller.Attack(), lockedShooting); dash.ResetDash(); jump.LeftWall(controller.Jump()); move.Wallride(controller.MoveHorizontal(), controller.Sprint()); } else if (stateMachine.WallRight()) { attack.WallAttackRight(controller.Attack(), lockedShooting); dash.ResetDash(); jump.RightWall(controller.Jump()); move.Wallride(controller.MoveHorizontal(), controller.Sprint()); } else { attack.AirborneAttack(controller.Attack(), lockedShooting, controller.MoveHorizontal(), controller.MoveVertical()); dash.Dash(controller.MoveHorizontal(), controller.MoveVertical(), controller.Dash()); jump.Airborne(controller.Jump()); move.Airborne(controller.MoveHorizontal(), controller.Sprint()); } } }
void FixedUpdate() { jump.SetContinousJump(controller.Jump(), controller.EndJump()); if (stateMachine.Grounded()) { jump.Grounded(controller.Jump(), controller.Sprint()); } else if (stateMachine.Airborne()) { if (stateMachine.WallLeft()) { jump.LeftWall(controller.Jump()); } else if (stateMachine.WallRight()) { jump.RightWall(controller.Jump()); } else { jump.Airborne(controller.Jump()); } } }