예제 #1
0
        //---------------------------------------------------------------------
        public void DestoryUi(UiBase ui)
        {
            foreach (var i in ListUi)
            {
                if (i == ui)
                {
                    i.OnDestroy();
                    ListUi.Remove(i);

                    Object.Destroy(i.ComUi.displayObject.gameObject);

                    return;
                }
            }
        }
예제 #2
0
        //---------------------------------------------------------------------
        public void CreateUi(string name)
        {
            UiFactory factory = null;

            MapUiFactory.TryGetValue(name, out factory);
            if (factory == null)
            {
                return;
            }

            UiBase ui = factory.CreateUi();

            ui.Name  = factory.GetName();
            ui.ComUi = UIPackage.CreateObject(ui.Name, ui.Name).asCom;
            GRoot.inst.AddChild(ui.ComUi);

            ListUi.Add(ui);

            ui.OnCreate();
        }