Пример #1
0
        /// <summary>
        /// Opens the U.
        /// </summary>
        /// <param name="_isCloseOther">If set to <c>true</c> is close other.</param>
        /// <param name="_uiTypes">User interface types.</param>
        /// <param name="_uiParams">User interface parameters.</param>
        public void OpenUI(bool _isCloseOther, EnumUIType[] _uiTypes, params object[] _uiParams)
        {
            // Close Others UI
            if (_isCloseOther)
            {
                CloseUIAll();
            }

            // Push _uiTypes
            for (int i = 0; i < _uiTypes.Length; i++)
            {
                EnumUIType _uiType = _uiTypes [i];

                //如果已经打开过了,就不再打开
                //只有通过CloseUI()关闭才会从字典中删除数据,否则会出问题。
                if (!dicOpenUIs.ContainsKey(_uiType))
                {
                    string _path = UIPathDefines.GetPrefabsPathByType(_uiType);
                    stackOpenUIs.Push(new UIInfoData(_uiType, _path, _uiParams));
                }
            }

            if (stackOpenUIs.Count > 0)
            {
                CoroutineController.Instance.StartCoroutine(AsyncLoadData());
            }
        }
Пример #2
0
        public void PreloadUI(EnumUIType _uiType)
        {
            string path = UIPathDefines.GetPrefabsPathByType(_uiType);

            Resources.Load(path);
        }