unity check if ui element is visible code example Example: how to clip out ui element if they are not inside an element unity // Add a "Rect Mask 2D" to the main parent