Ejemplo n.º 1
0
 //---------------------------------------------------------------------
 public void Destroy()
 {
     foreach (var i in ListUi)
     {
         i.OnDestroy();
     }
     ListUi.Clear();
 }
Ejemplo n.º 2
0
 public void InitializeListUi()
 {
     listUi = GetComponentInChildren <ListUi>();
     if (scrollRect == null)
     {
         scrollRect = GetComponentInChildren <ScrollRect>();
     }
     prefab_buttonUi = listUi.prefab_item;
     prefab_textUi   = Instantiate(prefab_buttonUi.gameObject).GetComponent <ListItemUi>();
     Destroy(prefab_textUi.GetComponent <Button>());
     Destroy(prefab_textUi.GetComponent <Image>());
 }
Ejemplo n.º 3
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;
                }
            }
        }
Ejemplo n.º 4
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();
        }