Reset input only if you click inside imgui

This commit is contained in:
js6pak committed 2021-02-06 17:31:15 +01:00
1 parent ad25d1f19c
commit ed47882d6c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ namespace Reactor.Extensions
Rect = Rect.ResetSize(); Rect = Rect.ResetSize();
Rect = GUILayout.Window(Id, Rect, Func, Title, new Il2CppReferenceArray<GUILayoutOption>(0)); Rect = GUILayout.Window(Id, Rect, Func, Title, new Il2CppReferenceArray<GUILayoutOption>(0));
if (Rect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) if ((Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) && Rect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
{ {
Input.ResetInputAxes(); Input.ResetInputAxes();
} }
+1 -1
View File
@@ -8,7 +8,7 @@ namespace Reactor.Patches
{ {
internal static class UiFocusPatch internal static class UiFocusPatch
{ {
// [HarmonyPatch(typeof(PassiveButtonManager), nameof(PassiveButtonManager.HandleFocus))] // [HarmonyPatch(typeof(PassiveButtonManager), nameof(PassiveButtonManager.HandleMouseOver))]
[HarmonyPatch] [HarmonyPatch]
public static class HandleFocusPatch public static class HandleFocusPatch
{ {