문제 해결링크

https://answers.unity.com/questions/1115464/ispointerovergameobject-not-working-with-touch-inp.html

 

IsPointerOverGameObject not working with touch input - Unity Answers

 

answers.unity.com

 

 

사용한 코드

    private bool IsPointerOverUIObject()
    {
        PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
        eventDataCurrentPosition.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
        List<RaycastResult> results = new List<RaycastResult>();
        EventSystem.current.RaycastAll(eventDataCurrentPosition, results);
        return results.Count > 0;
    }

사용법

 return이 true이면 Ui터치가 발생, false이면 Ui터치가 발생하지 않은 것입니다.