From d07e14add74e017b52ab2371efeea1aa4ea10ced Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 8 May 2021 23:15:13 +0800 Subject: +init --- Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs (limited to 'Assets/uGUI-2017.1/Editor/UI/ToggleEditor.cs') 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(); + } + } +} -- cgit v1.1-26-g67d0