{I+=codeWee;} |
bool isOnRectTransform() { PointerEventData pe = new PointerEventData(EventSystem.current); pe.position = Input.mousePosition; List<RaycastResult> hits = new List<RaycastResult>(); EventSystem.current.RaycastAll( pe, hits ); bool hit = false; foreach(RaycastResult h in hits) { GameObject g = h.go; hit = ( g.name != "BackgroundEventCatcher" && (g.GetComponent<RectTransform>()) ); if(hit) { return true; } } return false; }