From 22592c634c1898405e5c8cbbb47037d5248b7a9e Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Sun, 4 Feb 2024 17:12:29 -0300 Subject: [PATCH] Wrapped the InputManager so I can disable the games input when we enable the freecam (if it's using Unity's input solution). --- src/CSConsole/ConsoleController.cs | 12 +- src/Cinematic/IInputManager.cs | 235 ++++++++++++++++++ src/ExplorerBehaviour.cs | 12 +- src/ExplorerCore.cs | 3 +- src/Inspectors/MouseInspector.cs | 10 +- src/UI/DisplayManager.cs | 4 +- src/UI/Panels/AutoCompleteModal.cs | 12 +- src/UI/Panels/FreeCamPanel.cs | 42 ++-- src/UI/UIManager.cs | 2 +- .../Widgets/GameObjects/TransformControls.cs | 2 +- 10 files changed, 287 insertions(+), 47 deletions(-) create mode 100644 src/Cinematic/IInputManager.cs diff --git a/src/CSConsole/ConsoleController.cs b/src/CSConsole/ConsoleController.cs index 3765dcd..10de08d 100644 --- a/src/CSConsole/ConsoleController.cs +++ b/src/CSConsole/ConsoleController.cs @@ -227,11 +227,11 @@ namespace UnityExplorer.CSConsole if (SRENotSupported) return; - if (!InputManager.GetKey(KeyCode.LeftControl) && !InputManager.GetKey(KeyCode.RightControl)) + if (!IInputManager.GetKey(KeyCode.LeftControl) && !IInputManager.GetKey(KeyCode.RightControl)) { - if (InputManager.GetKeyDown(KeyCode.Home)) + if (IInputManager.GetKeyDown(KeyCode.Home)) JumpToStartOrEndOfLine(true); - else if (InputManager.GetKeyDown(KeyCode.End)) + else if (IInputManager.GetKeyDown(KeyCode.End)) JumpToStartOrEndOfLine(false); } @@ -250,8 +250,8 @@ namespace UnityExplorer.CSConsole } if (EnableCtrlRShortcut - && (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl)) - && InputManager.GetKeyDown(KeyCode.R) + && (IInputManager.GetKey(KeyCode.LeftControl) || IInputManager.GetKey(KeyCode.RightControl)) + && IInputManager.GetKeyDown(KeyCode.R) && timeOfLastCtrlR.OccuredEarlierThanDefault()) { timeOfLastCtrlR = Time.realtimeSinceStartup; @@ -267,7 +267,7 @@ namespace UnityExplorer.CSConsole return; // prevent escape wiping input - if (InputManager.GetKeyDown(KeyCode.Escape)) + if (IInputManager.GetKeyDown(KeyCode.Escape)) { Input.Text = previousInput; diff --git a/src/Cinematic/IInputManager.cs b/src/Cinematic/IInputManager.cs new file mode 100644 index 0000000..6c5ec64 --- /dev/null +++ b/src/Cinematic/IInputManager.cs @@ -0,0 +1,235 @@ +using System.Collections.Generic; + +using HarmonyLib; +using UnityEngine; +using UnityExplorer.UI; +using UnityExplorer.UI.Panels; +using UniverseLib.Input; + +namespace UnityExplorer +{ + + public class IInputManager { + + private static Dictionary getKeyDict = new Dictionary(); + private static Dictionary getKeyDownDict = new Dictionary(); + private static Dictionary getKeyUpDict = new Dictionary(); + + private static Dictionary getMouseButton = new Dictionary(); + private static Dictionary getMouseButtonDown = new Dictionary(); + + public static Vector3 MousePosition => InputManager.MousePosition; + + public static void Setup(){ + try + { + MethodInfo getKeyTarget = typeof(Input).GetMethod("GetKey", new Type[] {typeof(string)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyString)))); + } + catch { } + + try + { + MethodInfo getKeyTarget = typeof(Input).GetMethod("GetKey", new Type[] {typeof(KeyCode)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyKeyCode)))); + } + catch { } + + try + { + MethodInfo getKeyDownTarget = typeof(Input).GetMethod("GetKeyDown", new Type[] {typeof(string)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyDownTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyDownTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyDownString)))); + } + catch { } + + try + { + MethodInfo getKeyDownTarget = typeof(Input).GetMethod("GetKeyDown", new Type[] {typeof(KeyCode)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyDownTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyDownTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyDownKeyCode)))); + } + catch { } + + try + { + MethodInfo getKeyUpTarget = typeof(Input).GetMethod("GetKeyUp", new Type[] {typeof(string)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyUpTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyUpTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyUpString)))); + } + catch { } + + try + { + MethodInfo getKeyUpTarget = typeof(Input).GetMethod("GetKeyUp", new Type[] {typeof(KeyCode)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getKeyUpTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getKeyUpTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideKeyUpKeyCode)))); + } + catch { } + + try + { + MethodInfo getMouseButtonTarget = typeof(Input).GetMethod("GetMouseButton", new Type[] {typeof(int)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getMouseButtonTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getMouseButtonTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideMouseButton)))); + } + catch { } + + try + { + MethodInfo getMouseButtonDownTarget = typeof(Input).GetMethod("GetMouseButtonDown", new Type[] {typeof(int)}); +#if CPP + if (IL2CPPUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(getMouseButtonDownTarget) == null) + return; +#endif + ExplorerCore.Harmony.Patch(getMouseButtonDownTarget, + postfix: new(AccessTools.Method(typeof(IInputManager), nameof(OverrideMouseButtonDown)))); + } + catch { } + } + + // Postfix functions + + public static void OverrideKeyString(ref bool __result, ref string key) + { + KeyCode thisKeyCode = (KeyCode) System.Enum.Parse(typeof(KeyCode), key); + getKeyDict[thisKeyCode] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideKeyKeyCode(ref bool __result, ref KeyCode key) + { + if (key == KeyCode.None) return; + + getKeyDict[key] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideKeyDownString(ref bool __result, ref string key) + { + KeyCode thisKeyCode = (KeyCode) System.Enum.Parse(typeof(KeyCode), key); + getKeyDownDict[thisKeyCode] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideKeyDownKeyCode(ref bool __result, ref KeyCode key) + { + if (key == KeyCode.None) return; + + getKeyDownDict[key] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideKeyUpString(ref bool __result, ref string key) + { + KeyCode thisKeyCode = (KeyCode) System.Enum.Parse(typeof(KeyCode), key); + getKeyUpDict[thisKeyCode] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideKeyUpKeyCode(ref bool __result, ref KeyCode key) + { + if (key == KeyCode.None) return; + + getKeyUpDict[key] = __result; + if (FreeCamPanel.ShouldOverrideInput()){ + __result = false; + } + } + + public static void OverrideMouseButton(ref bool __result, ref int button) + { + getMouseButton[button] = __result; + // Since UnityExplorer uses Unity's native UI for its menu, we can't switch off the mouse interaction with it on this wrapper. + // Therefore, if we still want to interact with the Unity Explorer menu we would need to let the button action pass through when it's open. + if (FreeCamPanel.ShouldOverrideInput() && !(button == 0 && UIManager.ShowMenu)){ + __result = false; + } + } + + public static void OverrideMouseButtonDown(ref bool __result, ref int button) + { + getMouseButtonDown[button] = __result; + // Since UnityExplorer uses Unity's native UI for its menu, we can't switch off the mouse interaction with it on this wrapper. + // Therefore, if we still want to interact with the Unity Explorer menu we would need to let the button action pass through when it's open. + if (FreeCamPanel.ShouldOverrideInput() && button != 0){ + __result = false; + } + } + + // Wrapped methods + + public static bool GetKey(KeyCode key){ + if (key == KeyCode.None) return false; + // Trigger the original InputManager method + InputManager.GetKey(key); + return getKeyDict[key]; + } + + public static bool GetKeyDown(KeyCode key){ + if (key == KeyCode.None) return false; + // Trigger the original InputManager method + InputManager.GetKeyDown(key); + return getKeyDownDict[key]; + } + + public static bool GetKeyUp(KeyCode key){ + if (key == KeyCode.None) return false; + // Trigger the original InputManager method + InputManager.GetKeyUp(key); + return getKeyUpDict[key]; + } + + public static bool GetMouseButton(int button){ + // Trigger the original InputManager method + InputManager.GetMouseButton(button); + return getMouseButton[button]; + } + + public static bool GetMouseButtonDown(int button){ + // Trigger the original InputManager method + InputManager.GetMouseButtonDown(button); + return getMouseButtonDown[button]; + } + } +} diff --git a/src/ExplorerBehaviour.cs b/src/ExplorerBehaviour.cs index e01b5e6..2a4c10f 100644 --- a/src/ExplorerBehaviour.cs +++ b/src/ExplorerBehaviour.cs @@ -105,13 +105,13 @@ namespace UnityExplorer maybeForcePause(); UIManager.GetPanel(UIManager.Panels.Misc).MaybeTakeScreenshot(); - if (InputManager.GetKeyDown(ConfigManager.Pause.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Pause.Value)) { UIManager.GetTimeScaleWidget().PauseToggle(); } // FrameSkip - if (InputManager.GetKeyDown(ConfigManager.Frameskip.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Frameskip.Value)) { if (UIManager.GetTimeScaleWidget().IsPaused()) { UIManager.GetTimeScaleWidget().PauseToggle(); @@ -119,22 +119,22 @@ namespace UnityExplorer } } - if (InputManager.GetKeyDown(ConfigManager.Screenshot.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Screenshot.Value)) { UIManager.GetPanel(UIManager.Panels.Misc).screenshotStatus = UnityExplorer.UI.Panels.Misc.ScreenshotState.TurnOffUI; } - if (InputManager.GetKeyDown(ConfigManager.HUD_Toggle.Value)) + if (IInputManager.GetKeyDown(ConfigManager.HUD_Toggle.Value)) { UIManager.GetPanel(UIManager.Panels.Misc).ToggleHUDElements(); } - if (InputManager.GetKeyDown(ConfigManager.Freecam_Toggle.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Freecam_Toggle.Value)) { FreeCamPanel.StartStopButton_OnClick(); } - if (InputManager.GetKeyDown(ConfigManager.Block_Freecam_Movement.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Block_Freecam_Movement.Value)) { FreeCamPanel.blockFreecamMovementToggle.isOn = !FreeCamPanel.blockFreecamMovementToggle.isOn; } diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index b2407a1..221bd7b 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -59,6 +59,7 @@ namespace UnityExplorer //Extra inits KeypressListener.Setup(); + IInputManager.Setup(); } // Do a delayed setup so that objects aren't destroyed instantly. @@ -80,7 +81,7 @@ namespace UnityExplorer internal static void Update() { // check master toggle - if (InputManager.GetKeyDown(ConfigManager.Master_Toggle.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Master_Toggle.Value)) { UIManager.ShowMenu = !UIManager.ShowMenu; } diff --git a/src/Inspectors/MouseInspector.cs b/src/Inspectors/MouseInspector.cs index ec05c57..c7c6e2d 100644 --- a/src/Inspectors/MouseInspector.cs +++ b/src/Inspectors/MouseInspector.cs @@ -113,10 +113,10 @@ namespace UnityExplorer.Inspectors public bool TryUpdate() { - if (InputManager.GetKeyDown(ConfigManager.World_MouseInspect_Keybind.Value)) + if (IInputManager.GetKeyDown(ConfigManager.World_MouseInspect_Keybind.Value)) Instance.StartInspect(MouseInspectMode.World, inspectorAction); - if (InputManager.GetKeyDown(ConfigManager.UI_MouseInspect_Keybind.Value)) + if (IInputManager.GetKeyDown(ConfigManager.UI_MouseInspect_Keybind.Value)) Instance.StartInspect(MouseInspectMode.UI, inspectorAction); if (Inspecting) @@ -127,20 +127,20 @@ namespace UnityExplorer.Inspectors public void UpdateInspect() { - if (InputManager.GetKeyDown(KeyCode.Escape)) + if (IInputManager.GetKeyDown(KeyCode.Escape)) { StopInspect(); return; } - if (InputManager.GetMouseButtonDown(0)) + if (IInputManager.GetMouseButtonDown(0)) { CurrentInspector.OnSelectMouseInspect(inspectorAction); StopInspect(); return; } - Vector3 mousePos = InputManager.MousePosition; + Vector3 mousePos = IInputManager.MousePosition; if (mousePos != lastMousePos) UpdatePosition(mousePos); diff --git a/src/UI/DisplayManager.cs b/src/UI/DisplayManager.cs index 94d42ff..1a240c1 100644 --- a/src/UI/DisplayManager.cs +++ b/src/UI/DisplayManager.cs @@ -13,8 +13,8 @@ namespace UnityExplorer.UI public static int Height => ActiveDisplay.renderingHeight; public static Vector3 MousePosition => Application.isEditor - ? InputManager.MousePosition - : Display.RelativeMouseAt(InputManager.MousePosition); + ? IInputManager.MousePosition + : Display.RelativeMouseAt(IInputManager.MousePosition); public static bool MouseInTargetDisplay => MousePosition.z == ActiveDisplayIndex; diff --git a/src/UI/Panels/AutoCompleteModal.cs b/src/UI/Panels/AutoCompleteModal.cs index 04b028a..54de63c 100644 --- a/src/UI/Panels/AutoCompleteModal.cs +++ b/src/UI/Panels/AutoCompleteModal.cs @@ -100,14 +100,14 @@ namespace UnityExplorer.UI.Panels if (!Suggesting(handler)) return false; - bool up = InputManager.GetKey(KeyCode.UpArrow); - bool down = InputManager.GetKey(KeyCode.DownArrow); + bool up = IInputManager.GetKey(KeyCode.UpArrow); + bool down = IInputManager.GetKey(KeyCode.DownArrow); if (up || down) { if (up) { - if (InputManager.GetKeyDown(KeyCode.UpArrow)) + if (IInputManager.GetKeyDown(KeyCode.UpArrow)) { SetSelectedSuggestion(SelectedIndex - 1); timeOfLastNavHold = Time.realtimeSinceStartup + 0.3f; @@ -120,7 +120,7 @@ namespace UnityExplorer.UI.Panels } else { - if (InputManager.GetKeyDown(KeyCode.DownArrow)) + if (IInputManager.GetKeyDown(KeyCode.DownArrow)) { SetSelectedSuggestion(SelectedIndex + 1); timeOfLastNavHold = Time.realtimeSinceStartup + 0.3f; @@ -140,12 +140,12 @@ namespace UnityExplorer.UI.Panels public static bool CheckEnter(ISuggestionProvider handler) { - return Suggesting(handler) && InputManager.GetKeyDown(KeyCode.Return); + return Suggesting(handler) && IInputManager.GetKeyDown(KeyCode.Return); } public static bool CheckEscape(ISuggestionProvider handler) { - return Suggesting(handler) && InputManager.GetKeyDown(KeyCode.Escape); + return Suggesting(handler) && IInputManager.GetKeyDown(KeyCode.Escape); } private static void SetSelectedSuggestion(int index) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 395bfba..9b553f4 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -69,7 +69,7 @@ namespace UnityExplorer.UI.Panels { inFreeCamMode = true; - previousMousePosition = InputManager.MousePosition; + previousMousePosition = IInputManager.MousePosition; CacheMainCamera(); SetupFreeCamera(); @@ -524,6 +524,10 @@ namespace UnityExplorer.UI.Panels UpdateClippingPlanes(); } + + public static bool ShouldOverrideInput(){ + return inFreeCamMode; + } } internal class FreeCamBehaviour : MonoBehaviour @@ -564,39 +568,39 @@ namespace UnityExplorer.UI.Panels float moveSpeed = FreeCamPanel.desiredMoveSpeed * 0.01665f; //"0.01665f" (60fps) in place of Time.DeltaTime. DeltaTime causes issues when game is paused. float speedModifier = 1; - if (InputManager.GetKey(ConfigManager.Speed_Up_Movement.Value)) + if (IInputManager.GetKey(ConfigManager.Speed_Up_Movement.Value)) speedModifier = 10f; - if (InputManager.GetKey(ConfigManager.Speed_Down_Movement.Value)) + if (IInputManager.GetKey(ConfigManager.Speed_Down_Movement.Value)) speedModifier = 0.1f; moveSpeed *= speedModifier; - if (InputManager.GetKey(ConfigManager.Left_1.Value) || InputManager.GetKey(ConfigManager.Left_2.Value)) + if (IInputManager.GetKey(ConfigManager.Left_1.Value) || IInputManager.GetKey(ConfigManager.Left_2.Value)) transform.position += transform.right * -1 * moveSpeed; - if (InputManager.GetKey(ConfigManager.Right_1.Value) || InputManager.GetKey(ConfigManager.Right_2.Value)) + if (IInputManager.GetKey(ConfigManager.Right_1.Value) || IInputManager.GetKey(ConfigManager.Right_2.Value)) transform.position += transform.right * moveSpeed; - if (InputManager.GetKey(ConfigManager.Forwards_1.Value) || InputManager.GetKey(ConfigManager.Forwards_2.Value)) + if (IInputManager.GetKey(ConfigManager.Forwards_1.Value) || IInputManager.GetKey(ConfigManager.Forwards_2.Value)) transform.position += transform.forward * moveSpeed; - if (InputManager.GetKey(ConfigManager.Backwards_1.Value) || InputManager.GetKey(ConfigManager.Backwards_2.Value)) + if (IInputManager.GetKey(ConfigManager.Backwards_1.Value) || IInputManager.GetKey(ConfigManager.Backwards_2.Value)) transform.position += transform.forward * -1 * moveSpeed; - if (InputManager.GetKey(ConfigManager.Up.Value)) + if (IInputManager.GetKey(ConfigManager.Up.Value)) transform.position += transform.up * moveSpeed; - if (InputManager.GetKey(ConfigManager.Down.Value)) + if (IInputManager.GetKey(ConfigManager.Down.Value)) transform.position += transform.up * -1 * moveSpeed; - if (InputManager.GetKey(ConfigManager.Tilt_Left.Value)) + if (IInputManager.GetKey(ConfigManager.Tilt_Left.Value)) transform.Rotate(0, 0, moveSpeed, Space.Self); - if (InputManager.GetKey(ConfigManager.Tilt_Right.Value)) + if (IInputManager.GetKey(ConfigManager.Tilt_Right.Value)) transform.Rotate(0, 0, - moveSpeed, Space.Self); - if (InputManager.GetKey(ConfigManager.Tilt_Reset.Value)){ + if (IInputManager.GetKey(ConfigManager.Tilt_Reset.Value)){ // Extract the forward direction of the original quaternion Vector3 forwardDirection = transform.rotation * Vector3.forward; // Reset the tilt by creating a new quaternion with no tilt @@ -605,9 +609,9 @@ namespace UnityExplorer.UI.Panels transform.rotation = newRotation; } - if (InputManager.GetMouseButton(1)) + if (IInputManager.GetMouseButton(1)) { - Vector3 mouseDelta = InputManager.MousePosition - FreeCamPanel.previousMousePosition; + Vector3 mouseDelta = IInputManager.MousePosition - FreeCamPanel.previousMousePosition; if (mouseDelta.x != 0 || mouseDelta.y != 0){ // Calculate the mouse movement vector depending on the current camera tilt. float tiltAngle = transform.eulerAngles.z; @@ -622,26 +626,26 @@ namespace UnityExplorer.UI.Panels transform.localEulerAngles = new Vector3(newRotationY, newRotationX, transform.localEulerAngles.z); } - FreeCamPanel.previousMousePosition = InputManager.MousePosition; + FreeCamPanel.previousMousePosition = IInputManager.MousePosition; } - if (InputManager.GetKey(ConfigManager.Decrease_FOV.Value)) + if (IInputManager.GetKey(ConfigManager.Decrease_FOV.Value)) { FreeCamPanel.ourCamera.fieldOfView -= moveSpeed; } - if (InputManager.GetKey(ConfigManager.Increase_FOV.Value)) + if (IInputManager.GetKey(ConfigManager.Increase_FOV.Value)) { FreeCamPanel.ourCamera.fieldOfView += moveSpeed; } - if (InputManager.GetKey(ConfigManager.Reset_FOV.Value)){ + if (IInputManager.GetKey(ConfigManager.Reset_FOV.Value)){ FreeCamPanel.ourCamera.fieldOfView = FreeCamPanel.usingGameCamera ? FreeCamPanel.originalCameraFOV : 60; } FreeCamPanel.UpdatePositionInput(); - FreeCamPanel.previousMousePosition = InputManager.MousePosition; + FreeCamPanel.previousMousePosition = IInputManager.MousePosition; } } } diff --git a/src/UI/UIManager.cs b/src/UI/UIManager.cs index c4ca394..c67fa28 100644 --- a/src/UI/UIManager.cs +++ b/src/UI/UIManager.cs @@ -135,7 +135,7 @@ namespace UnityExplorer.UI Notification.Update(); // Check forceUnlockMouse toggle - if (InputManager.GetKeyDown(ConfigManager.Force_Unlock_Toggle.Value)) + if (IInputManager.GetKeyDown(ConfigManager.Force_Unlock_Toggle.Value)) UniverseLib.Config.ConfigManager.Force_Unlock_Mouse = !UniverseLib.Config.ConfigManager.Force_Unlock_Mouse; // update the timescale value diff --git a/src/UI/Widgets/GameObjects/TransformControls.cs b/src/UI/Widgets/GameObjects/TransformControls.cs index cf6ee71..979cd22 100644 --- a/src/UI/Widgets/GameObjects/TransformControls.cs +++ b/src/UI/Widgets/GameObjects/TransformControls.cs @@ -38,7 +38,7 @@ namespace UnityExplorer.UI.Widgets if (control == null) return; - if (!InputManager.GetMouseButton(0)) + if (!IInputManager.GetMouseButton(0)) { control.slider.value = 0f; control = null;