SCSlider2DEditor.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEditor;
  4. using UnityEditor.UI;
  5. using UnityEngine;
  6. namespace SC.XR.Unity
  7. {
  8. [CustomEditor(typeof(SCSlider2D), true)]
  9. [CanEditMultipleObjects]
  10. public class SCSlider2DEditor : SliderEditor
  11. {
  12. SerializedProperty m_OnPointerDown;
  13. SerializedProperty m_OnPointerUp;
  14. SerializedProperty m_OnDrag;
  15. protected override void OnEnable()
  16. {
  17. base.OnEnable();
  18. m_OnPointerDown = serializedObject.FindProperty("m_OnPointerDown");
  19. m_OnPointerUp = serializedObject.FindProperty("m_OnPointerUp");
  20. m_OnDrag = serializedObject.FindProperty("m_OnDrag");
  21. }
  22. public override void OnInspectorGUI()
  23. {
  24. base.OnInspectorGUI();
  25. serializedObject.Update();
  26. EditorGUILayout.PropertyField(m_OnPointerDown);
  27. EditorGUILayout.PropertyField(m_OnPointerUp);
  28. EditorGUILayout.PropertyField(m_OnDrag);
  29. serializedObject.ApplyModifiedProperties();
  30. }
  31. }
  32. }