示例#1
0
    public void FireGrapple()
    {
        ReleaseGrapple();
        activeJoint = Instantiate(HingePoint, gameObject.transform.position, Quaternion.identity) as GameObject;
        JointController jointController = activeJoint.GetComponent <JointController>();

        jointController.SetLastJointAnchor(rb);
        jointController.LaunchFirstJoint(grappleThrowForce, gameObject.transform.right, grappleLockTime);
    }
    public void FireGrapple()
    {
        //Vector3 mousePosition = Input.mousePosition;

        //mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
        //mousePosition.z = 0;
        //if (Vector2.Distance(gameObject.transform.position, mousePosition) > maxGrappleDistance)
        //  return;
        ReleaseGrapple();
        activeJoint = Instantiate(HingePoint, gameObject.transform.position, Quaternion.identity) as GameObject;
        JointController jointController = activeJoint.GetComponent <JointController>();

        jointController.SetLastJointAnchor(rb);
        jointController.LaunchFirstJoint(grappleThrowForce, gameObject.transform.right, grappleLockTime);
    }