Exemple #1
0
    public static void LoadPrefabUISprite(GameObject oGo, OnUIWidgetAtlasAllLoaded onLoaded, params object[] args)
    {
        if (oGo == null)
        {
            if (onLoaded != null)
            {
                onLoaded(oGo, args);
            }
            return;
        }
        UIWidget[] componentsInChildren = oGo.GetComponentsInChildren <UIWidget>(true);
        if (componentsInChildren == null)
        {
            if (onLoaded != null)
            {
                onLoaded(oGo, args);
            }
            return;
        }
        bool flag = false;

        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            UIWidget uIWidget = componentsInChildren[i];
            if (!(uIWidget == null))
            {
                if (uIWidget.CheckLoadAtlas(new OnUIWidgetAtlasLoaded(WidgetHelper.OnWidgetLoaded), componentsInChildren, onLoaded, oGo, args))
                {
                    flag = true;
                }
            }
        }
        if (!flag && onLoaded != null)
        {
            onLoaded(oGo, args);
        }
    }