Exemple #1
0
        /// <summary>
        /// 打开UI
        /// </summary>
        /// <param name="_isCloseOthers"></param>
        /// <param name="_uiTypes"></param>
        /// <param name="_uiParams"></param>
        public void OpenUI(bool _isCloseOthers, EnumUIType[] _uiTypes, params object[] _uiParams)
        {
            //Close Others UI
            if (_isCloseOthers)
            {
                CloseUIAll();
            }

            //Push _uiTypes in stack
            for (int i = 0; i < _uiTypes.Length; i++)
            {
                EnumUIType _uiType = _uiTypes[i];
                if (!dicOpenUIs.ContainsKey(_uiType))
                {
                    string _path = UIPathDefines.GetPrefabPathByType(_uiType);
                    stackOpenUIs.Push(new UIInfoData(_uiType, _path, _uiParams));
                }
            }

            // OPen UI,协同加载UI
            if (stackOpenUIs.Count > 0)
            {
                CoroutineController.Instance.StartCoroutine(AsyncLoadData());
            }
        }
Exemple #2
0
 public UIInfoData(EnumUIType _uiType, string _path, params object[] _uiParams)
 {
     UIType          = _uiType;
     Path            = _path;
     UIparams        = _uiParams;
     this.ScriptType = UIPathDefines.GetUIScriptByType(this.UIType);
 }
Exemple #3
0
        /// <summary>
        /// Preload the U.
        /// </summary>
        /// <param name="_uiType"></param>
        public void PreloadUI(EnumUIType _uiType)
        {
            string path = UIPathDefines.GetPrefabPathByType(_uiType);

            Resources.Load(path);
        }