using UnityEditor; using VketCloudGUITools.Runtime; namespace VketCloudGUITools.Editor { [CustomEditor(typeof(VCGUIItemBehaviour), isFallback = true)] public class VCGUIItemBehaviourInspector : UnityEditor.Editor { VCGUIItemInspectorHelper _helper = new VCGUIItemInspectorHelper(); VCStateToggleReordableList _toggleReordableList = new VCStateToggleReordableList(); protected virtual void OnEnable() { _helper.OnEnable(serializedObject, target as IVCGUIItem); } public void DrawPropertyScript() { EditorGUI.BeginDisabledGroup(true); _helper.DrawPropertyScript(); EditorGUI.EndDisabledGroup(); } public void DrawPropertyVcTransform() { EditorGUI.BeginDisabledGroup(true); _helper.DrawPropertyVcTransform(); EditorGUI.EndDisabledGroup(); } public void DrawPropertyVisible() { EditorGUI.BeginDisabledGroup(true); _helper.DrawPropertyVisible(); EditorGUI.EndDisabledGroup(); } public void DrawPropertyParentLayer() { EditorGUI.BeginDisabledGroup(true); _helper.DrawPropertyParentLayer(); EditorGUI.EndDisabledGroup(); } public void DrawPropertyToggleList(SerializedProperty toggleListProperty) { EditorGUI.BeginChangeCheck(); _toggleReordableList.OnInspectorGUI(serializedObject, toggleListProperty); if (EditorGUI.EndChangeCheck()) { // Delay Callにより、SerializedObjectの反映後に適応される EditorApplication.delayCall += () => { var item = (IVCGUIItem)this.target; item.UpdateVisible(); }; } } public void DrawPropertyShow() => _helper.DrawPropertyShow(); public void DrawPropertyPos() => _helper.DrawPropertyPos(); public void DrawPropertySize() => _helper.DrawPropertySize(); public void DrawPropertyZ() => _helper.DrawPropertyZ(); } }