コード例 #1
0
    public static QuickRope2 Create(GameObject pointA, GameObject pointB, List <Vector3> curvePoints, BasicRopeTypes ropeType)
    {
        QuickRope2 qr = pointA.AddComponent <QuickRope2>();

        qr.ropeEnd = pointB;

        switch (ropeType)
        {
        case BasicRopeTypes.NONE:
            break;

        case BasicRopeTypes.Line:
            qr.gameObject.AddComponent <QuickRope2Line>();
            break;

        case BasicRopeTypes.Prefab:
            qr.gameObject.AddComponent <QuickRope2Prefab>();
            break;

        case BasicRopeTypes.Mesh:
            qr.gameObject.AddComponent <QuickRope2Mesh>();
            break;

        case BasicRopeTypes.Cloth:
            qr.gameObject.AddComponent <QuickRope2Cloth>();
            break;
        }

        qr.ApplyRopeSettings();

        return(qr);
    }
コード例 #2
0
 void UpdateRope()
 {
     r.jointSpacing = Mathf.Clamp(r.jointSpacing, QuickRope2.MIN_JOINT_SPACING, QuickRope2.MAX_JOINT_SPACING);
     if (r.jointSpacing >= QuickRope2.MIN_JOINT_SPACING)
     {
         r.ApplyRopeSettings(); //r.SetControlPoints(r.ControlPoints);
     }
 }
コード例 #3
0
    void Start()
    {
        rope = QuickRope2.Create(Vector3.zero, new Vector3(0, -10, 0), BasicRopeTypes.Mesh);
        rope.enablePhysics        = true;
        rope.enableRopeController = true;
        rope.ApplyRopeSettings();

        rope.rigidbody.isKinematic = true;
    }
コード例 #4
0
    void Start()
    {
        rope = QuickRope2.Create(Vector3.zero, new Vector3(0, -10, 0), BasicRopeTypes.Mesh);
        rope.enablePhysics = true;
        rope.enableRopeController = true;
        rope.ApplyRopeSettings();

        rope.rigidbody.isKinematic = true;
    }
コード例 #5
0
    void OnEnable()
    {
        r = (QuickRope2)target;

        if (Application.isPlaying)
        {
            return;
        }

        CleanupObject();
        r.ApplyRopeSettings(); //r.SetControlPoints(r.ControlPoints);
    }
コード例 #6
0
    void OnEnable()
    {
        r = (QuickRope2)target;

        if (Application.isPlaying)
            return;

        CleanupObject();
        r.ApplyRopeSettings(); //r.SetControlPoints(r.ControlPoints);
    }