예제 #1
0
    void TetherInput()
    {
        hInput = Input.GetAxis("Horizontal");
        vInput = Input.GetAxis("Vertical");

        if (Input.GetButton("PullRope"))
        {
            Pullrope();
        }
        if (Input.GetButton("ReelInRope"))
        {
            if (!isGrounded)
            {
                if (tetherLength > 2)
                {
                    tetherLength -= Time.deltaTime * reelInMultiplier;
                }
            }
        }
        else if (Input.GetButton("ReelOutRope"))
        {
            if (tetherLength < maxTetherLength)
            {
                tetherLength += Time.deltaTime * reelInMultiplier;
            }
        }
        //if not grounded, if input ANY direction Input,
        if (Input.GetButtonDown("Jump"))//&& !isGrounded
        {
            if (!isGrounded)
            {
                PSF.SetRunning();
                PSF.DeattachTether();
                PSF.DeattachJump();
            }
        }
        if (Input.GetButtonDown("Deattach"))
        {
            PSF.DeattachTether();
            PSF.SetRunning();
        }
    }
 void DestroyProjectile()
 {
     //if player is attached to this, deattach player
     if (this.transform != null)
     {
         SetShouldBeDestroyed();
         if (playerAttach.GetTetherObject().GetInstanceID() != null)
         {
             if (playerAttach.GetTetherObject() != null)
             {
                 if (playerAttach.GetTetherObject().GetInstanceID() == this.transform.GetInstanceID())
                 {
                     //PSF.SetRunning();
                     PSF.SetRunning();
                     PSF.DeattachTether();
                     print("DEAATTACHING ROPE, SINCE THE ARROW THAT IM STUCK ON IS NOW GAWN");
                 }
             }
         }
     }
 }