示例#1
0
 public override void HandleInput()
 {
     if (mi.magnitude > 0f)
     {
         pi.currentState = new PlayerStateWalking(pi);
     }
     if (ji == 1f && pi.IsGrounded())
     {
         pi.currentState = new PlayerStateJumping(pi);
     }
     if (!pi.IsGrounded())
     {
         pi.currentState = new PlayerStateFalling(pi);
     }
     if (pi.GetDashInput() == 1f && pi.GetCanDash())
     {
         pi.currentState = new PlayerStateDash(pi);
     }
     if (ai == 1f)
     {
         pi.currentState = new PlayerStateAim(pi);
     }
     // if (ji == 1f && !pi.IsGrounded())
     //    pi.currentState = new PlayerStateSuperJump(pi);
 }
 public override void HandleInput()
 {
     if (mi.magnitude == 0f)
     {
         pi.currentState = new PlayerStateIdle(pi);
     }
     //check to see if a spell input was pressed
     if (ji == 1f && pi.IsGrounded())
     {
         pi.currentState = new PlayerStateJumping(pi);
     }
     if (pi.GetDashInput() == 1f && pi.GetCanDash())
     {
         pi.currentState = new PlayerStateDash(pi);
     }
     if (!pi.IsGrounded())
     {
         pi.currentState = new PlayerStateFalling(pi);
     }
     if (ai == 1f)
     {
         pi.currentState = new PlayerStateAim(pi);
     }
     // if (ji == 1f && !pi.IsGrounded())
     //    pi.currentState = new PlayerStateSuperJump(pi);
 }
示例#3
0
 public override void HandleInput()
 {
     if (jumpInput == 0f || jumpProgress > 1f)
     {
         pi.currentState = new PlayerStateFalling(pi);
     }
     if (pi.playerScript.GetCanClimb() != null)
     {
         //Ensure that the player is snapping to the right point, correctly getting the y axis
         Vector3 p = pi.playerScript.GetCanClimb().GetComponent <LedgeScript>().CalculateCorrectPointToSnapTo(pi.GetPlayerTransform().position);
         pi.playerScript.SetPlayerPosition(p);
         pi.currentState = new PlayerStateHangingOnLedge(pi, pi.playerScript.GetCanClimb());
     }
     if (pi.GetDashInput() == 1f && pi.GetCanDash())
     {
         pi.currentState = new PlayerStateDash(pi);
     }
 }
示例#4
0
 public override void HandleInput()
 {
     if (superJumpReady && jumpInput == 1f && pi.GetJumpCount() > 0)
     {
         pi.currentState = new PlayerStateJumping(pi);
     }
     if (pi.IsGrounded())
     {
         pi.currentState = new PlayerStateIdle(pi);
     }
     if (pi.playerScript.GetCanClimb() != null)
     {
         //Ensure that the player is snapping to the right point, correctly getting the y axis
         Vector3 p = pi.playerScript.GetCanClimb().GetComponent <LedgeScript>().CalculateCorrectPointToSnapTo(pi.GetPlayerTransform().position);
         pi.playerScript.SetPlayerPosition(p);
         pi.currentState = new PlayerStateHangingOnLedge(pi, pi.playerScript.GetCanClimb());
     }
     if (pi.GetDashInput() == 1f && pi.GetCanDash())
     {
         pi.currentState = new PlayerStateDash(pi);
     }
 }