2023-06-29 14:57:11 +08:00
|
|
|
using System;
|
2023-06-05 19:57:17 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
using UnityEngine.UIElements;
|
|
|
|
using UnityEditor;
|
|
|
|
using UnityEditor.UIElements;
|
|
|
|
#endif
|
|
|
|
namespace BITKit
|
|
|
|
{
|
|
|
|
public class BITInputSystem
|
|
|
|
{
|
|
|
|
[RuntimeInitializeOnLoadMethod]
|
|
|
|
static void Reload()
|
|
|
|
{
|
|
|
|
AllowInput = new();
|
|
|
|
}
|
|
|
|
public static ValidHandle AllowInput = new();
|
|
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
public class BITInputSystemEditor : EditorWindow
|
|
|
|
{
|
2023-06-29 14:57:11 +08:00
|
|
|
Toggle allowInput;
|
2023-06-05 19:57:17 +08:00
|
|
|
[MenuItem("Tools/InputSystemEditor")]
|
|
|
|
static void Entry()
|
|
|
|
{
|
|
|
|
GetWindow<BITInputSystemEditor>().Show();
|
|
|
|
}
|
2023-06-29 14:57:11 +08:00
|
|
|
|
|
|
|
private void OnEnable()
|
2023-06-05 19:57:17 +08:00
|
|
|
{
|
2023-06-29 14:57:11 +08:00
|
|
|
rootVisualElement.style.paddingLeft =
|
|
|
|
rootVisualElement.style.paddingTop =
|
|
|
|
rootVisualElement.style.paddingRight =
|
|
|
|
rootVisualElement.style.paddingBottom = 16;
|
|
|
|
rootVisualElement.Add(allowInput =new Toggle());
|
|
|
|
allowInput.text = "Enable Input";
|
2023-06-05 19:57:17 +08:00
|
|
|
}
|
2023-06-29 14:57:11 +08:00
|
|
|
private void Update()
|
2023-06-05 19:57:17 +08:00
|
|
|
{
|
2023-06-29 14:57:11 +08:00
|
|
|
allowInput.value = BITInputSystem.AllowInput;
|
2023-06-05 19:57:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|