Beispiel #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);
 }
 public void HandleInput()
 {
     if (mi.magnitude == 0f)
     {
         pi.currentState = new PlayerStateIdle(pi);
     }
     //check to see if a spell input was pressed
     for (int i = 0; i < spellInputTable.Length; i++)
     {
         if (spellInputTable[i] == 1f && cancelSpell == 0f)
         {
             //Decide if the spell should be cast, or is being aimed
             pi.currentState = new PlayerStateAiming(pi, i);
         }
     }
     if (ji == 1f && pi.IsGrounded())
     {
         pi.currentState = new PlayerStateJumping(pi, true);
     }
 }
Beispiel #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);
     }
 }