AlicizaX/Client/Packages/com.alicizax.unity.event/Editor/Inspector/EventComponentInspector.cs

33 lines
879 B
C#
Raw Normal View History

2025-01-23 19:06:48 +08:00
using AlicizaX.Editor;
using AlicizaX.Event.Runtime;
using UnityEditor;
namespace AlicizaX.Event.Editor
{
[CustomEditor(typeof(EventComponent))]
2025-04-28 19:45:45 +08:00
internal sealed class EventComponentInspector : GameFrameworkInspector
2025-01-23 19:06:48 +08:00
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (!EditorApplication.isPlaying)
{
EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info);
return;
}
EventComponent t = (EventComponent)target;
if (IsPrefabInHierarchy(t.gameObject))
{
EditorGUILayout.LabelField("Event Handler Count", t.EventHandlerCount.ToString());
EditorGUILayout.LabelField("Event Count", t.EventCount.ToString());
}
Repaint();
}
}
2025-04-28 19:45:45 +08:00
}