mirror of https://github.com/hykilpikonna/AquaDX
[F] Mouse input with 1P mode
parent
2251350a4e
commit
8b83205b0a
|
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue