Example #1
0
        public void AddToGroup(FUI fui, ViewGroup grp)
        {
            if (!(fui.GObject is GComponent com))
            {
                throw new Exception($"this ui is not GComponent,  {fui.Name}");
            }
            int newComDepth;

            if (com.packageItem != null)
            {
                newComDepth = GetViewDepth(com.packageItem.name);
            }
            else
            {
                newComDepth = s_cDefaultViewDepth;
            }
            if (grp != ViewGroup.None && m_FGUIGrps[(int)grp] != null)
            {
                //GComponent viewGrp = m_FGUIGrps[(int)grp];
                FUI viewGrp = m_FGUIGrps[(int)ViewGroup.View];
                int iIndex  = viewGrp.numChildren;
                for (int i = 0; i < viewGrp.numChildren; i++)
                {
                    GObject child = viewGrp.GObject.asCom.GetChildAt(i);
                    if (child == null)
                    {
                        continue;
                    }
                    int childDepth;
                    if (child.packageItem == null)
                    {
                        childDepth = s_cDefaultViewDepth;
                    }
                    else
                    {
                        childDepth = GetViewDepth(child.packageItem.name);
                    }
                    if (childDepth > newComDepth)
                    {
                        iIndex = i;
                        break;
                    }
                }
                viewGrp.Add(fui, iIndex);
            }
        }
Example #2
0
 public void Add(FUI ui, bool asChildGObject)
 {
     Root?.Add(ui, asChildGObject);
 }