diff options
author | chai <215380520@qq.com> | 2024-03-13 11:02:11 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-13 11:02:11 +0800 |
commit | 63546b0dc7b142b30b090257f523bc9a9e13b36b (patch) | |
tree | a86b65e3bbd9a919b1df69e86b2f0183694c7d9f /ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs | |
parent | 795a1ed126a8992b072c81a4d6dea307d07b7747 (diff) |
+ model
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs')
-rw-r--r-- | ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs b/ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs new file mode 100644 index 0000000..a8be3d6 --- /dev/null +++ b/ActiveRagdoll/Assets/TABG/Scripts/Utils/Editor/DisplayAllJointsEditor.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +[CustomEditor(typeof(DisplayAllJoints))] +public class DisplayAllJointsEditor : Editor +{ + + protected void OnSceneGUI() + { + DisplayAllJoints display = (DisplayAllJoints)target; + + Transform[] childrens = display.gameObject.GetComponentsInChildren<Transform>(); + + for (int i = 0; i < childrens.Length; ++i) + { + Transform child = childrens[i]; + if (child == display.transform) + { + continue; + } + Transform transform = child.transform; + Handles.color = Handles.xAxisColor; + Handles.ArrowHandleCap( + 0, + transform.position, + transform.rotation * Quaternion.LookRotation(Vector3.right), + display.size, + EventType.Repaint + ); + Handles.color = Handles.yAxisColor; + Handles.ArrowHandleCap( + 0, + transform.position, + transform.rotation * Quaternion.LookRotation(Vector3.up), + display.size, + EventType.Repaint + ); + Handles.color = Handles.zAxisColor; + Handles.ArrowHandleCap( + 0, + transform.position, + transform.rotation * Quaternion.LookRotation(Vector3.forward), + display.size, + EventType.Repaint + ); + } + } +} |