using UnityEngine; using UnityEditor; using System; using UnityEditor.SceneManagement; namespace UltraControls { [CustomEditor(typeof(UltraGetter))] [CanEditMultipleObjects] [Serializable] public class UltraGetterEditor : Editor { private UltraGetter m_master; public SerializedProperty m_property_is_started; public SerializedProperty m_property_name; public SerializedProperty m_property_identifierInFile; public SerializedProperty m_property_auto_load; void OnEnable() { if (m_master == null) { m_master = target as UltraGetter; } m_property_is_started = serializedObject.FindProperty("m_is_started"); m_property_name = serializedObject.FindProperty("m_name"); //m_property_identifierInFile = serializedObject.FindProperty("m_identifierInFile"); //m_property_auto_load = serializedObject.FindProperty("m_auto_load_after_finding_getter"); } void OnDisable() { } public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(m_property_is_started, new UnityEngine.GUIContent("Start")); EditorGUI.BeginDisabledGroup(m_property_is_started.boolValue); { EditorGUILayout.PropertyField(m_property_name, new UnityEngine.GUIContent("Name")); } EditorGUI.EndDisabledGroup(); serializedObject.ApplyModifiedProperties(); m_master.is_start = m_property_is_started.boolValue; if (!m_master.is_start) { m_master.ultracontros_name = m_property_name.stringValue; return; } EditorGUILayout.Separator(); if (!Application.isPlaying) { m_master.UpdateByUltraGetterEditor(); } }//OnInspectorGUI() }//UltraGetterEditor }//namespace UltraControls