暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ButtonEditor.cs 872B

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine.UI;
  2. namespace UnityEditor.UI
  3. {
  4. [CustomEditor(typeof(Button), true)]
  5. [CanEditMultipleObjects]
  6. /// <summary>
  7. /// Custom Editor for the Button Component.
  8. /// Extend this class to write a custom editor for a component derived from Button.
  9. /// </summary>
  10. public class ButtonEditor : SelectableEditor
  11. {
  12. SerializedProperty m_OnClickProperty;
  13. protected override void OnEnable()
  14. {
  15. base.OnEnable();
  16. m_OnClickProperty = serializedObject.FindProperty("m_OnClick");
  17. }
  18. public override void OnInspectorGUI()
  19. {
  20. base.OnInspectorGUI();
  21. EditorGUILayout.Space();
  22. serializedObject.Update();
  23. EditorGUILayout.PropertyField(m_OnClickProperty);
  24. serializedObject.ApplyModifiedProperties();
  25. }
  26. }
  27. }