PlayerJumpDownAbility.cs 490 B

123456789101112131415161718192021222324
  1. using System;
  2. using ExtensionMethods;
  3. public class PlayerJumpDownAbility : CharacterState
  4. {
  5. public override void Start()
  6. {
  7. this._platform = this.pac.GetComponent<PlatformMovement>();
  8. }
  9. public void JumpDown()
  10. {
  11. if (!this.stateMachine.currentState.IsInArray(PlayerAction.NormalSta))
  12. {
  13. return;
  14. }
  15. if (this._platform.IgnoreOnOneWayGround())
  16. {
  17. this.pac.ChangeState(PlayerAction.StateEnum.Fall1, 1f);
  18. }
  19. }
  20. private PlatformMovement _platform;
  21. }