Пример #1
0
 public void Jump(InputAction.CallbackContext context)
 {
     if (CanJump)
     {
         if (context.started)
         {
             PlayerJump.ResetJumpCharge();
             IsJumpCharging = true;
             BoardFX.SetCrouching(true);
             PlayerEvents.Instance.StartJumpCharge();
             IsJumping = true;
         }
         else if (context.canceled && IsJumping && IsJumpCharging)
         {
             PlayerJump.Jump();
             PlayerJump.StartLandingBuffer();
             BoardFX.PlayJumpJetParticles();
             PlayerJump.ResetJumpCharge();
             IsJumpCharging = false;
             BoardFX.SetCrouching(false);
             PlayerEvents.Instance.Jump();
         }
     }
     else if (context.canceled)
     {
         PlayerEvents.Instance.HandleJumpAfterAim();
         IsJumpCharging = false;
     }
 }