42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using AlicizaX.Editor;
|
|
using AlicizaX.Fsm.Runtime;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace AlicizaX.Fsm.Editor
|
|
{
|
|
[CustomEditor(typeof(FsmComponent))]
|
|
public class FsmModuleInspector : GameFrameworkInspector
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
serializedObject.Update();
|
|
FsmComponent t = (FsmComponent)target;
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info);
|
|
return;
|
|
}
|
|
List<FsmDebugInfo> debugInfos = t.GetAllFsmList();
|
|
EditorGUILayout.BeginVertical("box");
|
|
{
|
|
GUIStyle boldWhiteStyle = new GUIStyle(EditorStyles.label)
|
|
{
|
|
fontStyle = FontStyle.Bold,
|
|
normal = { textColor = Color.white }
|
|
};
|
|
EditorGUILayout.LabelField("\tID\tFsmName\tStateName", boldWhiteStyle);
|
|
int index = 1;
|
|
foreach (var info in debugInfos)
|
|
{
|
|
EditorGUILayout.LabelField($"\t{index}\t{info.FsmName}\t{info.CurrentStateName}");
|
|
index++;
|
|
}
|
|
}
|
|
EditorGUILayout.EndVertical();
|
|
}
|
|
}
|
|
}
|