FTriggerBuffEventInspector.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using UnityEngine;
  2. using UnityEditor;
  3. using Flux;
  4. namespace FluxEditor
  5. {
  6. [CustomEditor(typeof(FTriggerBuffEvent))]
  7. public class FTriggerBuffEventInspector : FEventInspector
  8. {
  9. private FTriggerBuffEvent _buffEvent = null;
  10. private SerializedProperty _buffId = null;
  11. private SerializedProperty _rate = null;
  12. protected override void OnEnable()
  13. {
  14. base.OnEnable();
  15. _buffEvent = (FTriggerBuffEvent)target;
  16. _buffId = serializedObject.FindProperty("_buffId");
  17. _rate = serializedObject.FindProperty("_rate");
  18. }
  19. public override void OnInspectorGUI()
  20. {
  21. base.OnInspectorGUI();
  22. serializedObject.Update();
  23. EditorGUILayout.BeginHorizontal();
  24. GUILayout.Label("触发buffid:", EditorStyles.label, GUILayout.Width(140));
  25. _buffId.intValue = EditorGUILayout.IntField(_buffId.intValue, GUILayout.Width(300));
  26. EditorGUILayout.EndHorizontal();
  27. EditorGUILayout.BeginHorizontal();
  28. GUILayout.Label("触发buff概率:", EditorStyles.label, GUILayout.Width(140));
  29. _rate.intValue = EditorGUILayout.IntField(_rate.intValue, GUILayout.Width(300));
  30. EditorGUILayout.EndHorizontal();
  31. serializedObject.ApplyModifiedProperties();
  32. }
  33. }
  34. }