public void JumpOff() { groundScript.Jump(); parentBodyRope = null; parentColliderRope = null; transform.parent = null; }
void Update() { if (!isDeath) { if (isInputJump()) { if (pushPullScript.isPullingObject()) { pushPullScript.releaseObject(); } if (groundScript.GetTouchGround()) { groundScript.Jump(); } //else if (ropeScript.isClimbRope()) { //ropeScript.JumpOff(); //} } if (isInputFire1()) { ping = shadowScript.isActive; if (!shadowScript.isActive) { shadowScript.activate(); } else { shadowScript.deactivate(); //firing(); } } } }
private void HandleInput() { if (Input.GetKey(KeyCode.D)) { _normalizedHorizontalSpeed = 1; if (!_isFacingRight) { Flip(); } } else if (Input.GetKey(KeyCode.A)) { _normalizedHorizontalSpeed = -1; if (_isFacingRight) { Flip(); } } else { _normalizedHorizontalSpeed = 0; } if (_controller.CanJump && Input.GetKeyDown(KeyCode.Space)) { _controller.Jump(); } }
// Update is called once per frame void Update() { /*if (isClimbingLadder && isLadderSet) { * movingObject (); * }*/ playerAnimation.SetBool("isClimbingRope", isClimbingLadder); onLadderArea = updateLadderArea(0, 0, 0, 0); if (!isClimbingLadder && onLadderArea) { float verticalInput; verticalInput = Input.GetAxis("Vertical"); if (!isClimbingLadder && (verticalInput > 0.1 || verticalInput < -0.1)) { stickToMiddle(); } } if (!onLadderArea && isClimbingLadder) { unstickFromLadder(); } if (isClimbingLadder && isLadderSet && Input.GetAxis("Jump") > 0) { unstickFromLadder(); groundScript.Jump(); } }
// Update is called once per frame void Update() { playerAnimation.SetBool("isClimbLadder", isClimbingLadder); onLadderArea = updateLadderArea(0, 0, 0, 0); if (!isClimbingLadder && onLadderArea) { float verticalInput; verticalInput = Input.GetAxis("Vertical"); if ((!isClimbingLadder && (verticalInput > 0.1 || verticalInput < -0.1)) && !(playerScript.immovable)) { stickToMiddle(); } } if (!onLadderArea && isClimbingLadder) { unstickFromLadder(); } if (isClimbingLadder && isLadderSet && playerScript.isInputJump()) { unstickFromLadder(); groundScript.Jump(); } }