Ejemplo n.º 1
0
 //动态增加ui时需传入uipath,在uitype和uiname中均需要配置
 public UIOperateBase showUI <T>(UITypes type, string path = "") where T : UIOperateBase
 {
     if (!_UIList.ContainsKey(type))
     {
         if (!checkNameConfig(type))
         {
             return(null);
         }
         string name = UIName.Type2Name[type];
         if (path == "")
         {
             _UIList.Add(type, UIOperateBase.New <T>(name));
         }
         else
         {
             _UIList.Add(type, UIOperateBase.DynamicNew <T>(name, path));
         }
     }
     _UIList[type].Open();
     if (!checkIsHUDUI(type))
     {
         updateOpenCout(1);
     }
     EventManager.SendEvent(EventMacro.SHOW_UI, type);
     _layerController.updateLayer(type, UILayers.HIGHEST);
     return(_UIList[type]);
 }
Ejemplo n.º 2
0
 public void register(UIOperateBase ui)
 {
     if (!_UIList.ContainsKey(ui.uiType))
     {
         _UIList.Add(ui.uiType, ui);
     }
 }
Ejemplo n.º 3
0
 void AddChild(UIOperateBase child)
 {
     if (childrenList.Contains(child))
     {
         return;
     }
     childrenList.Add(child);
 }
Ejemplo n.º 4
0
    public void SetParent(UIOperateBase parent)
    {
        this.transform.parent = parent.transform;
        this.parent           = parent;
        parent.AddChild(this);
        RectTransform rectTrans = GetComponent <RectTransform>();

        rectTrans.anchorMin = new Vector2(0.5f, 0.5f);
        rectTrans.anchorMax = new Vector2(0.5f, 0.5f);
    }
Ejemplo n.º 5
0
 public virtual void Dispose()
 {
     foreach (UIOperateBase child in childrenList)
     {
         child.Dispose();
     }
     this.transform.parent = null;
     this.parent           = null;
     Destroy(viewGo);
     viewGo = null;
 }
Ejemplo n.º 6
0
        public void registerUI <T>(UITypes type) where T : UIOperateBase
        {
            if (!checkNameConfig(type))
            {
                return;
            }

            string name = UIName.Type2Name[type];

            _UIList.Add(type, UIOperateBase.New <T>(name));
            _layerController.register(_UIList[type]);
        }
Ejemplo n.º 7
0
 public void OpenText()
 {
     if (itemBag == null)
     {
         itemBag = UIOperateBase.New <UIOpBag> ("Bag");
     }
     else
     {
         itemBag.Open();
     }
     //text.gameObject.SetActive (true);
 }
Ejemplo n.º 8
0
 void Awake()
 {
     uiOpRoot = GameObject.Find("Canvas").AddComponent <UIOperateBase>();
 }