コード例 #1
0
    public void Attach(BalloonString _balloonString, BalloonString.GrabSlot _grabSlot)
    {
        // Ignore if this was the last balloon we grabbed onto
        if (lastGrabbed == _balloonString)
        {
            return;
        }

        if (frozenTime > 0.0f)
        {
            return;
        }

        Vector3 newPosition = _grabSlot.transform.position;

        newPosition.z = transform.position.z;

        transform.position  = newPosition;
        transform.rotation  = _grabSlot.transform.rotation;
        joint.connectedBody = _balloonString.GetComponent <Rigidbody2D>();
        currentGrabSlot     = _grabSlot;
        joint.enabled       = true;
        lastGrabbed         = _balloonString;

        jumpsRemaining = numJumps;
    }
コード例 #2
0
 public void ReleaseBalloonString()
 {
     if (IsGrabbingBalloonString())
     {
         currentGrabSlot.playerInUse = null;
         currentGrabSlot             = null;
         joint.connectedBody         = null;
         joint.enabled = false;
     }
 }