ソースコード
public bool IsExist() { var current = EventSystem.current; var eventData = new PointerEventData( current ) { position = Input.mousePosition }; var raycastResults = new List<RaycastResult>(); current.RaycastAll( eventData, raycastResults ); var isExist = 0 < raycastResults.Count; return isExist; }
使い方
var isExist = IsExist();