mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 19:27:26 +08:00
[F] Mouse input with 1P mode
This commit is contained in:
@@ -21,12 +21,10 @@ namespace AquaMai.UX
|
|||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(MeshButton), "IsPointInPolygon", new Type[] { typeof(Vector2[]), typeof(Vector2) })]
|
[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;
|
__result = RectTransformUtility.RectangleContainsScreenPoint(__instance.GetComponent<RectTransform>(), point, Camera.main);
|
||||||
point = new Vector2(point.x - (screenWidth / 2), point.y);
|
return false;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user