FChangeSkillEventInspector.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using UnityEngine;
  2. using UnityEditor;
  3. using Flux;
  4. namespace FluxEditor
  5. {
  6. [CustomEditor(typeof(FChangeSkillEvent))]
  7. public class FChangeSkillEventInspector : FEventInspector
  8. {
  9. private FChangeSkillEvent _changeSkillEvent = null;
  10. private SerializedProperty _fromSkillId = null;
  11. private SerializedProperty _toSkillId = null;
  12. protected override void OnEnable()
  13. {
  14. base.OnEnable();
  15. _changeSkillEvent = (FChangeSkillEvent)target;
  16. _fromSkillId = serializedObject.FindProperty("_fromSkillId");
  17. _toSkillId = serializedObject.FindProperty("_toSkillId");
  18. }
  19. public override void OnInspectorGUI()
  20. {
  21. base.OnInspectorGUI();
  22. serializedObject.Update();
  23. EditorGUILayout.BeginHorizontal();
  24. GUILayout.Label("原技能ID:", EditorStyles.label, GUILayout.Width(140));
  25. _fromSkillId.stringValue = EditorGUILayout.TextField(_fromSkillId.stringValue, GUILayout.Width(300));
  26. EditorGUILayout.EndHorizontal();
  27. EditorGUILayout.BeginHorizontal();
  28. GUILayout.Label("替换的新技能ID:", EditorStyles.label, GUILayout.Width(140));
  29. _toSkillId.stringValue = EditorGUILayout.TextField(_toSkillId.stringValue, GUILayout.Width(300));
  30. EditorGUILayout.EndHorizontal();
  31. serializedObject.ApplyModifiedProperties();
  32. }
  33. }
  34. }