2024-12-13 15:46:59 +08:00
|
|
|
|
using AxibugEmuOnline.Client;
|
2024-09-12 16:20:11 +08:00
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
namespace AxibugEmuOnline.Editors
|
|
|
|
|
{
|
|
|
|
|
[CustomEditor(typeof(CommandDispatcher))]
|
|
|
|
|
public class CommandDispatcherEditor : Editor
|
|
|
|
|
{
|
|
|
|
|
public override void OnInspectorGUI()
|
|
|
|
|
{
|
|
|
|
|
base.OnInspectorGUI();
|
|
|
|
|
|
2024-12-13 15:46:59 +08:00
|
|
|
|
if (!Application.isPlaying) return;
|
|
|
|
|
|
2024-09-12 16:20:11 +08:00
|
|
|
|
var dispacather = target as CommandDispatcher;
|
|
|
|
|
|
|
|
|
|
dispacather.GetRegisters(out var normal, out var solo);
|
|
|
|
|
|
|
|
|
|
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
|
|
|
|
EditorGUILayout.LabelField("NORMAL");
|
|
|
|
|
foreach (var item in normal)
|
|
|
|
|
{
|
|
|
|
|
Draw(item);
|
|
|
|
|
}
|
|
|
|
|
EditorGUILayout.EndVertical();
|
|
|
|
|
|
|
|
|
|
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
|
|
|
|
EditorGUILayout.LabelField("SOLO");
|
|
|
|
|
foreach (var item in solo)
|
|
|
|
|
{
|
|
|
|
|
Draw(item);
|
|
|
|
|
}
|
|
|
|
|
EditorGUILayout.EndVertical();
|
|
|
|
|
|
2024-12-04 00:04:31 +08:00
|
|
|
|
EditorGUILayout.LabelField(dispacather.Current.Name);
|
|
|
|
|
|
2024-09-12 16:20:11 +08:00
|
|
|
|
Repaint();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Draw(CommandExecuter item)
|
|
|
|
|
{
|
|
|
|
|
EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
|
|
|
|
|
using (new EditorGUI.DisabledGroupScope(!item.Enable))
|
|
|
|
|
EditorGUILayout.ObjectField(item.gameObject, typeof(GameObject), false);
|
|
|
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|