/// <summary> /// Opens the U. /// </summary> /// <param name="_isCloseOthers">If set to <c>true</c> _is close others.</param> /// <param name="_uiTypes">_ui types.</param> /// <param name="_uiParams">_ui parameters.</param> private void OpenUI(bool _isCloseOthers, UIType[] _uiTypes, bool _bAsync, params object[] _uiParams) { // Close Others UI. if (_isCloseOthers) { CloseUIAll(); } // push _uiTypes in Stack. for (int i = 0; i < _uiTypes.Length; i++) { UIType _uiType = _uiTypes[i]; if (!dicOpenUIs.ContainsKey(_uiType)) { // UI不存在,获取UI预制体路径 string _path = UIPathDefines.GetPrefabPathByType(_uiType); // UI信息堆栈:UI类型,UI预制体路径,参数,(UI指定View脚本) stackOpenUIs.Push(new UIInfoData(_uiType, _path, _uiParams)); } } // Open UI. if (stackOpenUIs.Count > 0) { if (_bAsync) { MonoHelper.Instance.StartCoroutine(AsyncLoadData()); } else { LoadUIData(); } } }
public UIInfoData(UIType _uiType, string _path, params object[] _uiParams) { this.UIType = _uiType; this.Path = _path; this.UIParams = _uiParams; this.ScriptType = UIPathDefines.GetUIScriptByType(this.UIType); }
/// <summary> /// Preloads the U. /// </summary> /// <param name="_uiType">_ui type.</param> public void PreloadUI(UIType _uiType) { string path = UIPathDefines.GetPrefabPathByType(_uiType); Resources.Load(path); //ResManager.Instance.ResourcesLoad(path); }