FairyGUI.UIPackage.LoadComponentChildren C# (CSharp) Method

LoadComponentChildren() private method

private LoadComponentChildren ( PackageItem item ) : void
item PackageItem
return void
        void LoadComponentChildren(PackageItem item)
        {
            XML listNode = item.componentData.GetNode("displayList");
            if (listNode != null)
            {
                XMLList col = listNode.Elements();
                int dcnt = col.Count;
                item.displayList = new DisplayListItem[dcnt];
                DisplayListItem di;
                for (int i = 0; i < dcnt; i++)
                {
                    XML cxml = col[i];

                    string src = cxml.GetAttribute("src");
                    if (src != null)
                    {
                        string pkgId = cxml.GetAttribute("pkg");
                        UIPackage pkg;
                        if (pkgId != null && pkgId != item.owner.id)
                            pkg = UIPackage.GetById(pkgId);
                        else
                            pkg = item.owner;

                        PackageItem pi = pkg != null ? pkg.GetItem(src) : null;
                        if (pi != null)
                            di = new DisplayListItem(pi, null);
                        else
                            di = new DisplayListItem(null, cxml.name);
                    }
                    else
                    {
                        if (cxml.name == "text" && cxml.GetAttributeBool("input", false))
                            di = new DisplayListItem(null, "inputtext");
                        else
                            di = new DisplayListItem(null, cxml.name);
                    }

                    di.desc = cxml;
                    item.displayList[i] = di;
                }
            }
            else
                item.displayList = new DisplayListItem[0];
        }