SpatialTriggerInspector.cs 932 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace EZXR.Glass.UI
  6. {
  7. [CustomEditor(typeof(SpatialTrigger))]
  8. [CanEditMultipleObjects]
  9. public class SpatialTriggerInspector : SpatialSelectableInspector
  10. {
  11. private SpatialTrigger _target_SpatialTriggerInspector;
  12. SerializedProperty onTriggerEnter;
  13. protected override void OnEnable()
  14. {
  15. base.OnEnable();
  16. _target_SpatialTriggerInspector = target as SpatialTrigger;
  17. onTriggerEnter = serializedObject.FindProperty("onTriggerEnter");
  18. }
  19. public override void OnInspectorGUI()
  20. {
  21. base.OnInspectorGUI();
  22. serializedObject.Update();
  23. EditorGUILayout.PropertyField(onTriggerEnter);
  24. serializedObject.ApplyModifiedProperties();
  25. SceneView.RepaintAll();
  26. }
  27. }
  28. }