diff options
Diffstat (limited to 'Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs')
-rw-r--r-- | Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs b/Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs new file mode 100644 index 0000000..632e4d0 --- /dev/null +++ b/Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs @@ -0,0 +1,46 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace UnityEditor.UI +{ + [CustomEditor(typeof(Toggle), true)] + [CanEditMultipleObjects] + public class ToggleEditor : SelectableEditor + { + SerializedProperty m_OnValueChangedProperty; + SerializedProperty m_TransitionProperty; + SerializedProperty m_GraphicProperty; + SerializedProperty m_GroupProperty; + SerializedProperty m_IsOnProperty; + + protected override void OnEnable() + { + base.OnEnable(); + + m_TransitionProperty = serializedObject.FindProperty("toggleTransition"); + m_GraphicProperty = serializedObject.FindProperty("graphic"); + m_GroupProperty = serializedObject.FindProperty("m_Group"); + m_IsOnProperty = serializedObject.FindProperty("m_IsOn"); + m_OnValueChangedProperty = serializedObject.FindProperty("onValueChanged"); + } + + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + EditorGUILayout.Space(); + + serializedObject.Update(); + EditorGUILayout.PropertyField(m_IsOnProperty); + EditorGUILayout.PropertyField(m_TransitionProperty); + EditorGUILayout.PropertyField(m_GraphicProperty); + EditorGUILayout.PropertyField(m_GroupProperty); + + EditorGUILayout.Space(); + + // Draw the event notification options + EditorGUILayout.PropertyField(m_OnValueChangedProperty); + + serializedObject.ApplyModifiedProperties(); + } + } +} |