private void ApplyToIconPanel(UIPanel groupPanel, IconPanelModifier modifier, bool verticalScroll) { if (groupPanel == null) { return; } if (modifier == null) { return; } try{ //seperator panels do not have UIScrollablePanels nor UIScrollbars UITabContainer tabContainer = groupPanel.GetComponentInChildren <UITabContainer>(); foreach (UIComponent comp in tabContainer.components) //for each displayable panel of icons { if (comp is UIPanel) { UIPanel panel = comp as UIPanel; UIScrollablePanel sp = panel.GetComponentInChildren <UIScrollablePanel>(); UIScrollbar sb = panel.GetComponentInChildren <UIScrollbar>(); modifier.Invoke(panel, sp, sb, verticalScroll); panel.Invalidate(); sp.Invalidate(); sb.Invalidate(); } } tabContainer.Invalidate(); }catch (Exception e) { //Debug.Print(groupPanel,e); } }