LTDescr.colorRecursive C# (CSharp) Method

colorRecursive() private static method

private static colorRecursive ( RectTransform rectTransform, Color toColor ) : void
rectTransform UnityEngine.RectTransform
toColor Color
return void
    private static void colorRecursive( RectTransform rectTransform, Color toColor )
    {
        if(rectTransform.childCount>0){
            foreach (RectTransform child in rectTransform) {
                UnityEngine.UI.MaskableGraphic uiImage = child.GetComponent<UnityEngine.UI.Image>();
                if (uiImage != null) {
                    uiImage.color = toColor;
                } else {
                    uiImage = child.GetComponent<UnityEngine.UI.RawImage>();
                    if (uiImage != null)
                        uiImage.color = toColor;
                }
                colorRecursive(child, toColor);
            }
        }
    }

Same methods

LTDescr::colorRecursive ( Transform transform, Color toColor, bool useRecursion = true ) : void
LTDescr