From 0d1ff35b8ca99b7eb378047e67ff613cf4e0e1f0 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sat, 27 Jul 2024 05:47:45 +0800 Subject: [PATCH] [+] Fix DebugInput (MouseTouchPanel) --- Fix/BasicFix.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Fix/BasicFix.cs b/Fix/BasicFix.cs index 01e12697..f0741396 100644 --- a/Fix/BasicFix.cs +++ b/Fix/BasicFix.cs @@ -3,6 +3,7 @@ using AMDaemon.Allnet; using HarmonyLib; using Manager; using Manager.Operation; +using UnityEngine; namespace AquaMai.Fix; @@ -48,4 +49,36 @@ public class BasicFix __result = true; return false; } + + [HarmonyPrefix] + [HarmonyPatch(typeof(DebugInput), "GetKey")] + private static bool GetKey(ref bool __result, KeyCode name) + { + __result = UnityEngine.Input.GetKey(name); + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(DebugInput), "GetKeyDown")] + private static bool GetKeyDown(ref bool __result, KeyCode name) + { + __result = UnityEngine.Input.GetKeyDown(name); + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(DebugInput), "GetMouseButton")] + private static bool GetMouseButton(ref bool __result, int button) + { + __result = UnityEngine.Input.GetMouseButton(button); + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(DebugInput), "GetMouseButtonDown")] + private static bool GetMouseButtonDown(ref bool __result, int button) + { + __result = UnityEngine.Input.GetMouseButtonDown(button); + return false; + } }