// calculate size and scale
UIRoot mRoot
= GameObject
.FindObjectOfType (typeof(UIRoot
)) as UIRoot
; float ratio = (float)mRoot.activeHeight / Screen.height;
int width = (int)Mathf.Ceil(Screen.width * ratio);
int height = (int)Mathf.Ceil(Screen.height * ratio);
// item width
float cWidth = ticketPlaceholder.GetComponent<UIGrid>().cellWidth;
// camera bounds
float x = ticketScroll.GetComponent<UIPanel> ().clipOffset.x;
float cLeft = x - (width/2f);
float cRight = x + (width/2f);
int counter = 0;
foreach (CardController card in ticketsCardList) {
// item bounds
float itemXCenter = ( cWidth * counter );
float itemLCenter = itemXCenter - (cWidth/2f);
float itemRCenter = itemXCenter + (cWidth/2f);
// is item visible, do not hide whole item, must leave base UIWidget, hide inside
bool isVis = (itemRCenter > cLeft && itemLCenter < cRight ) || (itemLCenter < cRight && itemRCenter > cLeft ) || (itemLCenter > cLeft && itemRCenter < cRight );
card.Show(isVis);
counter++;
}