protected virtual void TrackChildrenComponents() { if (PropagateToChildrens) { if (Owner != null) { _spriteRendererChildrens = new List <SpriteRenderer>(Owner.GetComponentsInChildren <SpriteRenderer>()); #if NGUI_DLL _uiWidgetChildrens = new List <UIWidget>(Owner.GetComponentsInChildren <UIWidget>()); _uiPanelChildrens = new List <UIPanel>(Owner.GetComponentsInChildren <UIPanel>()); #endif CanvasGroup[] v_canvasChildrens = Owner.GetComponentsInChildren <CanvasGroup>(); _uiCanvasGroupChildrens.Clear(); foreach (CanvasGroup v_group in v_canvasChildrens) { if (v_group != null && v_group.ignoreParentGroups) { _uiCanvasGroupChildrens.Add(v_group); } } MaskableGraphic[] v_maskableChildrens = Owner.GetComponentsInChildren <MaskableGraphic>(); _uiGraphicsChildrens.Clear(); foreach (MaskableGraphic v_maskable in v_maskableChildrens) { if (v_maskable != null) { bool v_isChild = false; foreach (CanvasGroup v_group in v_canvasChildrens) { if (v_group != null && KiltUtils.IsChildObject(v_group.gameObject, v_maskable.gameObject, true)) { v_isChild = true; break; } } if (!v_isChild) { _uiGraphicsChildrens.Add(v_maskable); } } } Renderer[] v_rendererChildrens = Owner.GetComponentsInChildren <Renderer>(); _materialChildrens.Clear(); foreach (Renderer v_renderer in v_rendererChildrens) { if (v_renderer != null && v_renderer.material != null) { if (v_renderer.material.HasProperty("_Color")) { _materialChildrens.Add(v_renderer.material); } } } } } else { _uiCanvasGroupChildrens.Clear(); _uiGraphicsChildrens.Clear(); _spriteRendererChildrens.Clear(); _materialChildrens.Clear(); #if NGUI_DLL _uiWidgetChildrens.Clear(); _uiPanelChildrens.Clear(); #endif } }