diff options
author | chai <215380520@qq.com> | 2023-10-20 10:09:38 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-10-20 10:09:38 +0800 |
commit | 0b7f9f32d31ac36bc74485ab2a5ad023af4b4950 (patch) | |
tree | 6f32e50d1d28e1cff8b3ce8925810d47c13ce31b /Docs/TAB_AddJointDebug.txt | |
parent | 88ca8dad6d4cba11f9380f452d7cd419bee014e4 (diff) |
*misc
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>(); + } + } + +} + |