Example #1
0
        internal static void ProcessUILayer(int layer, UIFrame ui)
        {
            if (layer < 0)
            {
                return;
            }
            Dictionary <int, List <UIFrame> > .Enumerator e = layerUI.GetEnumerator();
            UIFrame uf    = null;
            int     group = ui.GetGroup();

            List <UIFrame> dirtyUI = new List <UIFrame>();

            while (e.MoveNext())
            {
                if (e.Current.Key < 0)
                {
                    continue;
                }
                if (e.Current.Key == layer)
                {
                    for (int i = 0, count = e.Current.Value.Count; i < count; i++)
                    {
                        uf = e.Current.Value[i];
                        if (uf != ui)
                        {
                            if (group <= 0 || uf.GetGroup() != group)
                            {
                                uf.Show(false);
                                if (uf.IsDirty())
                                {
                                    dirtyUI.Add(uf);
                                }
                            }
                        }
                    }
                }
                else if (e.Current.Key > layer)
                {
                    for (int i = 0, count = e.Current.Value.Count; i < count; i++)
                    {
                        uf = e.Current.Value[i];
                        if (group <= 0 || uf.GetGroup() != group)
                        {
                            uf.Show(false);
                            if (uf.IsDirty())
                            {
                                dirtyUI.Add(uf);
                            }
                        }
                    }
                }
            }

            for (int i = 0, count = dirtyUI.Count; i < count; i++)
            {
                UnRegisterUILayer(dirtyUI[i].GetLayer(), dirtyUI[i]);
            }
        }
Example #2
0
        private static void ProcessUIShow(UIFrame ui, bool show)
        {
            if (ui == null)
            {
                return;
            }

            ui.Show(show);
        }
Example #3
0
        public static void DeleteUI(UIFrame ui)
        {
            if (ui == null)
            {
                return;
            }
            if (ui.IsShowing())
            {
                ui.Show(false);
            }

            ui.DirtyDel();
            allUI.Remove(ui.name);
            indexToUI.Remove(ui.id);
        }