using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Object = UnityEngine.Object; #if UNITY_EDITOR using UnityEngine.UIElements; using UnityEditor; using UnityEditor.UIElements; using UnityEngine.InputSystem; #endif namespace BITKit { public class BITInputSystem { [RuntimeInitializeOnLoadMethod] static void Reload() { AllowInput = new(); } public static ValidHandle AllowInput = new(); } #if UNITY_EDITOR public class BITInputSystemEditor : EditorWindow { private Toggle allowInput; private Toggle allowInputLog; private InputAction _inputAction; private ObjectField inputActionField; private Label nameLabel; private Label valueLabel; [MenuItem("Tools/InputSystemEditor")] private static void Open() { GetWindow().Show(); } private void OnEnable() { rootVisualElement.style.paddingLeft = rootVisualElement.style.paddingTop = rootVisualElement.style.paddingRight = rootVisualElement.style.paddingBottom = 16; rootVisualElement.Add(allowInput =new Toggle()); allowInput.text = "Enable Input"; allowInput.SetEnabled(false); allowInput.style.opacity = 1; allowInputLog = rootVisualElement.Create(); allowInputLog.text = "Enable Input Log"; inputActionField = rootVisualElement.Create(); inputActionField.label = "Debug InputAction"; inputActionField.RegisterValueChangedCallback(NewValue); inputActionField.objectType = typeof(InputActionReference); var hContainer = rootVisualElement.Create(); hContainer.style.flexDirection = FlexDirection.Row; nameLabel = hContainer.Create