private void fixAutoAnchor()
 {
     if (!_revoluteJointObject.autoConfigureAnchor)
     {
         return;
     }
     //更新anchor
     _revoluteJointObject.updateAutoAnchor();
     //记录新的anchor
     _oldLocalAnchor1.SetV(_revoluteJointObject.localAnchor1);
     _oldLocalAnchor2.SetV(_revoluteJointObject.localAnchor2);
 }
Exemple #2
0
    /**修复b2RevoluteJoint*/
    private static void fixB2RevoluteJointWithTransform(Transform transform)
    {
        b2RevoluteJointObject revoluteJointObj = transform.GetComponent <b2RevoluteJointObject>();

        if (revoluteJointObj != null)
        {
            revoluteJointObj.updateAutoAnchor();
        }

        for (int i = 0; i < transform.childCount; i++)
        {
            fixB2RevoluteJointWithTransform(transform.GetChild(i));
        }
    }