EventComponentInspector.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using UnityEditor;
  8. using UnityGameFramework.Runtime;
  9. namespace UnityGameFramework.Editor
  10. {
  11. [CustomEditor(typeof(EventComponent))]
  12. internal sealed class EventComponentInspector : GameFrameworkInspector
  13. {
  14. public override void OnInspectorGUI()
  15. {
  16. base.OnInspectorGUI();
  17. if (!EditorApplication.isPlaying)
  18. {
  19. EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info);
  20. return;
  21. }
  22. EventComponent t = (EventComponent)target;
  23. if (IsPrefabInHierarchy(t.gameObject))
  24. {
  25. EditorGUILayout.LabelField("Event Handler Count", t.EventHandlerCount.ToString());
  26. EditorGUILayout.LabelField("Event Count", t.EventCount.ToString());
  27. }
  28. Repaint();
  29. }
  30. private void OnEnable()
  31. {
  32. }
  33. }
  34. }