public void ResetMovement() { controller.StopMovement(); controller.Jump(false); leftClicked = 0; rightClicked = 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); } }
public virtual void OnJump() { if (player.isGrounded) { player.Jump(); } }
// 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 }