//https://forum.unity.com/threads/extending-instead-of-replacing-built-in-inspectors.407612/ using System; using System.Reflection; using UnityEngine; using UnityEditor; [CustomEditor(typeof(Transform), true)] [CanEditMultipleObjects] public class TransformInspector : InspectorExt { Transform transform; bool s_ShowInformation = false; protected override string defaultEditorName => "UnityEditor.TransformInspector, UnityEditor"; public override void OnEnable() { base.OnEnable(); transform = target as Transform; s_ShowInformation = false; } public override void OnDisable() { base.OnDisable(); s_ShowInformation = false; } public override void OnInspectorGUI() { EditorGUILayout.LabelField("Local Space", EditorStyles.boldLabel); defaultEditor.OnInspectorGUI(); if(BeginMore()) { // ÊÀ½ç×ø±ê EditorGUILayout.LabelField("World Space", EditorStyles.boldLabel); GUI.enabled = false; EditorGUILayout.Vector3Field("Position", transform.position); EditorGUILayout.Vector3Field("Rotation", transform.rotation.ToEuler() * Mathf.Rad2Deg); EditorGUILayout.Vector3Field("Scale", transform.lossyScale); GUI.enabled = true; } EndMore(); } }