解决方案 : http://www.cnblogs.com/fly-100/p/4570366.html
这里我们直接在使用Input.GetMouseButtonDown(0)的地方加了一个检测函数,CheckGuiRaycastObjects,如下
bool CheckGuiRaycastObjects() { PointerEventData eventData = new PointerEventData(Main.Instance.eventSystem); eventData.pressPosition = Input.mousePosition; eventData.position = Input.mousePosition; List<RaycastResult> list = new List<RaycastResult>(); Main.Instance.graphicRaycaster.Raycast(eventData, list); //Debug.Log(list.Count); return list.Count > 0; }