//动态增加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]); }
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]); }
public void OpenText() { if (itemBag == null) { itemBag = UIOperateBase.New <UIOpBag> ("Bag"); } else { itemBag.Open(); } //text.gameObject.SetActive (true); }