示例#1
0
 public void JumpOff()
 {
     groundScript.Jump();
     parentBodyRope     = null;
     parentColliderRope = null;
     transform.parent   = null;
 }
示例#2
0
 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();
             }
         }
     }
 }
示例#3
0
    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();
        }
    }
示例#4
0
    // 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();
        }
    }
示例#5
0
    // 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();
        }
    }