/// <summary> /// 打开UI /// </summary> /// <param name="_isCloseOther"></param> /// <param name="_uiTypes"></param> /// <param name="_uiParams"></param> public void OpenUI(bool _isCloseOther, EnumUIType[] _uiTypes, params object[] _uiParams) { //Close Others UI. if (_isCloseOther) { CloseUIAll(); } //Push _uiTypes in stack. for (int i = 0; i < _uiTypes.Length; i++) { EnumUIType _uiType = _uiTypes[i]; if (!dicOpenUIs.ContainsKey(_uiType)) { string _path = UIPathDefines.GetPrefabsPathByType(_uiType); stackOpenUIs.Push(new UIInfoData(_uiType, _path, _uiParams)); } } //Open UI,协程加载UI. if (stackOpenUIs.Count > 0) { CoroutineController.Instance.StartCoroutine(AsyncLoadData()); } }
public UIInfoData(EnumUIType _uiType, string _path, params object[] _uiParams) { this.UIType = _uiType; this.Path = _path; this.UIparams = _uiParams; this.ScriptType = UIPathDefines.GetUIScriptByType(this.UIType); }
/// <summary> /// 预加载UI /// </summary> /// <param name="_uiType"></param> public void PreloadUI(EnumUIType _uiType) { string path = UIPathDefines.GetPrefabsPathByType(_uiType); Resources.Load(path); }