12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- public class CubeHelper : MonoBehaviour
- {
- //public GameObject CubePrefab;
- //private const string CubeName = "Highlight";
- //[MenuItem("Highlight/Add Highlight")]
- //public static void RecalculateColliders()
- //{
- // var joints = FindObjectsOfType<HingeJoint>();
- // foreach (HingeJoint joint in joints)
- // {
- // for (var i = 0; i < joint.transform.childCount; i++)
- // {
- // if (joint.transform.GetChild(i).name == CubeName)
- // {
- // DestroyImmediate(joint.transform.GetChild(i).gameObject);
- // }
- // }
- // if (joint.gameObject.activeSelf)
- // {
- // //GameObject go = Instantiate(Resources.Load<GameObject>(CubeName));
- // //go.transform.SetParent(joint.transform);
- // //go.name = CubeName;
- // //go.transform.localScale = Vector3.one * 0.1f;
- // //go.transform.localPosition = Vector3.zero;
- // //go.transform.localRotation = Quaternion.identity;
- // //var h = joint.gameObject.AddComponent<JointsHighlighter>();
- // //h.HighCube = go;
-
-
- // var cJoint = joint.gameObject.AddComponent<ConfigurableJoint>();
- // cJoint.connectedAnchor = joint.connectedAnchor;
- // cJoint.axis = joint.axis;
- // cJoint.anchor = joint.anchor;
- // cJoint.connectedBody = joint.connectedBody;
- // cJoint.massScale = joint.massScale;
- // DestroyImmediate(joint);
- // }
-
- // }
- //}
- }
|