Exemple #1
0
 private void CheckInput()
 {
     if (!canInput)
     {
         return;
     }
     moveInputDir = Input.GetAxisRaw("Horizontal");
     if (Input.GetButtonDown("Jump"))
     {
         rm.Uncrouch();
         Jump();
     }
     else if (Input.GetButtonUp("Jump") && jumpedLastFrame)
     {
         rm.ShortenJump();
         jumpedLastFrame = false;
     }
     else if (Input.GetAxisRaw("Vertical") < 0)
     {
         if (isGrounded)
         {
             Crouch();
         }
     }
     else if (Input.GetAxisRaw("Vertical") >= 0)
     {
         if (isCrouching)
         {
             Uncrouch();
         }
     }
     if (Input.GetButtonDown("Push"))
     {
         pushll.currAction = Pushing;
     }
     else if (Input.GetButtonDown("Pull"))
     {
         pushll.currAction = Pulling;
     }
     else if ((Input.GetButtonUp("Push") && pushll.currAction == Pushing) ||
              (Input.GetButtonUp("Pull") && pushll.currAction == Pulling))
     {
         pushll.currAction = None;
     }
 }