[F] Mouse input with 1P mode

pull/40/head
Clansty 2024-05-22 12:04:36 +08:00
parent 2251350a4e
commit 8b83205b0a
1 changed files with 4 additions and 6 deletions

View File

@ -21,12 +21,10 @@ namespace AquaMai.UX
[HarmonyPrefix]
[HarmonyPatch(typeof(MeshButton), "IsPointInPolygon", new Type[] { typeof(Vector2[]), typeof(Vector2) })]
public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point)
public static bool IsPointInPolygon(Vector2[] polygon, ref Vector2 point, MeshButton __instance, ref bool __result)
{
var screenWidth = Screen.width;
point = new Vector2(point.x - (screenWidth / 2), point.y);
return true;
__result = RectTransformUtility.RectangleContainsScreenPoint(__instance.GetComponent<RectTransform>(), point, Camera.main);
return false;
}
}
}
}