UGUI UI层阻挡射线

public bool checkUI() {

  PointerEventData data = new PointerEventData(eventSystem);
  data.pressPosition = Input.mousePosition;
  data.position= Input.mousePosition;
  List<RaycastResult>list = new List<RaycastResult>();
  RaycastInCanvas.Raycast(data,list);
     return list.Count > 0;
}

posted @ 2017-10-13 11:53  Erise  阅读(1005)  评论(0编辑  收藏  举报