Пример #1
0
        /// <summary>
        /// 显示UI
        /// </summary>
        /// <param name="_type"></param>
        void ShowUI(UIType _type)
        {
            UIPlane _uiPlane = _PlaneDictionary.TryGet(_type);

            if (_uiPlane != null)
            {
                _uiPlane.Begin();
                return;
            }
            else
            {
                _uiPlane = CreateUI(_type);
                if (_uiPlane == null)
                {
                    return;
                }
            }
        }
Пример #2
0
        UIPlane CreateUI(UIType _type)
        {
            string path = _PathDictionary.TryGet(_type);

            if (path.Equals(""))
            {
                return(null);
            }

            UIPlane _temp = (GameObject.Instantiate(Resources.Load(path)) as GameObject).GetComponent <UIPlane>();

            _temp.transform.SetParent(_CanvasTransform, false);
            _PlaneDictionary.Add(_type, _temp);

            //清除路径
            _PathDictionary.Remove(_type);

            return(_temp);
        }