Skip to content

Commit 2a4679c

Browse files
committed
fix(Util): Over GUI on mobile
1 parent 2df0a7b commit 2a4679c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Assets/JCSUnity/Scripts/Util/JCS_UIUtil.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,13 +888,17 @@ public static bool MouseOverGUI(RectTransform imageRect, RectTransform rootPanel
888888
/// </returns>
889889
public static bool IsOverGUI()
890890
{
891+
return IsOverGUI(0);
892+
}
893+
public static bool IsOverGUI(int index)
894+
{
891895
#if (UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL)
892896
return EventSystem.current.IsPointerOverGameObject();
893897
#elif (UNITY_ANDROID || UNITY_IPHIONE || UNITY_IOS)
894-
if (Input.touchCount <= 0)
898+
if (Input.touchCount <= index)
895899
return false;
896900

897-
Touch touch = Input.GetTouch(0);
901+
Touch touch = Input.GetTouch(index);
898902

899903
return EventSystem.current.IsPointerOverGameObject(touch.fingerId);
900904
#else

0 commit comments

Comments
 (0)