diff options
Diffstat (limited to 'Docs/TAB_AddJointDebug.txt')
-rw-r--r-- | Docs/TAB_AddJointDebug.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Docs/TAB_AddJointDebug.txt b/Docs/TAB_AddJointDebug.txt new file mode 100644 index 0000000..e8de306 --- /dev/null +++ b/Docs/TAB_AddJointDebug.txt @@ -0,0 +1,29 @@ +string name = "Armature_Target"; +GameObject go = GameObject.Find(name); +if (go != null) +{ + + var comps = go.GetComponentsInChildren<MonoBehaviour>(); + if (comps != null) + { + for (int j = 0; j < comps.Length; j++) + { + if (comps[j].GetType().Name == "DebugRigidBody") + { + UnityEngine.Object.DestroyImmediate(comps[j]); + } + } + } + + var joints = go.GetComponentsInChildren<FollowRig>(); + if(joints != null) + { + for(int i = 0; i < joints.Length; i++) + { + Debug.Log(joints[i].gameObject.name); + joints[i].gameObject.AddComponent<DebugRigidBody>(); + } + } + +} + |