35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
using SepCore.InputModule.Runtime;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace SepCore.InputModule.Editor
|
|
{
|
|
[CustomEditor(typeof(InputModuleComponent))]
|
|
public sealed class InputModuleComponentEditor : UnityEditor.Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
|
|
if (!Application.isPlaying)
|
|
{
|
|
EditorGUILayout.Space(8);
|
|
EditorGUILayout.HelpBox("Runtime state is only available in Play Mode.", MessageType.Info);
|
|
return;
|
|
}
|
|
|
|
var component = (InputModuleComponent)target;
|
|
|
|
EditorGUILayout.Space(10);
|
|
EditorGUILayout.LabelField("Runtime State", EditorStyles.boldLabel);
|
|
|
|
EditorGUI.BeginDisabledGroup(true);
|
|
EditorGUILayout.Toggle("Initialized", component.IsInitialized);
|
|
EditorGUILayout.EnumPopup("Device Kind", component.CurrentDeviceKind);
|
|
EditorGUILayout.EnumPopup("Current Context", component.CurrentContext);
|
|
EditorGUILayout.Toggle("Rebinding", component.IsRebinding);
|
|
EditorGUI.EndDisabledGroup();
|
|
}
|
|
}
|
|
}
|