示例#1
0
 public void ResetMovement()
 {
     controller.StopMovement();
     controller.Jump(false);
     leftClicked  = 0;
     rightClicked = 0;
 }
示例#2
0
 void CheckToPush()
 {
     //Para empujar el cofre debe de estar vacío y el player debe de estar andando hacia el cofre
     if (playerController.isWalking)
     {
         if (!Game.chestEmpty)
         {
             //Hay que vaciar el cofre primero
             playerController.StopPlayerMove();
             chest.buttonsDisabled = true;
             sequencer.StartCoroutine("StartSequence", sequenceName);
         }
         else if (!playerController.isJumping && !playerController.isOnChest)
         {
             rabbitCollider.enabled = true;
             joint.enabled          = true;
             rigidBody.bodyType     = RigidbodyType2D.Dynamic;
             submitButtonImage.SetActive(false);
             cancelButtonImage.SetActive(true);
             playerController.isPushing = true;
             animator.SetBool("isPushing", true);
         }
     }
     else
     if (!playerController.isOnChest && !playerController.isPushing && !chest.isAtBottom)
     {
         playerController.StartCoroutine(playerController.Jump(jumpPosition.position, true));
         CheckForUpdateOffset(onUpPosition);
     }
 }
示例#3
0
 public virtual void OnJump()
 {
     if (player.isGrounded)
     {
         player.Jump();
     }
 }
示例#4
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log("sdfsdfsdf");
        //saut
        if (Input.GetKeyDown(KeyCode.Space))
        {
            controller.Jump();
        }

        //déplacement horizontal
        dir = Input.GetAxisRaw("Horizontal"); //-1 gauche     1 droite     0 bouge pas
    }