Exemplo n.º 1
0
        /// <summary>
        /// 打开加载等待动画
        /// </summary>
        public void ShowLoadingLockUI(string message = "Loading...", LoadingLockData data = null)
        {
            var uic = Game.Scene.GetComponent <UIComponent>();

            if (uic.Get(UIType.UILoadingLock) != null)
            {
                return;
            }

            GameObject gameObject = LoadUIAsset(UIType.UILoadingLock);

            UI ui = ComponentFactory.Create <UI, string, GameObject>(UIType.UILoadingLock, gameObject, false);

            var loadingLock = ui.AddComponent <UILoadingLock>();

            Game.Scene.GetComponent <UIComponent>().Add(ui);

            if (data == null)
            {
                data = new LoadingLockData();
            }

            data.mes = message;

            loadingLock.OnOpen(data);
        }
Exemplo n.º 2
0
        public async void OnOpen(object arg = null)
        {
            if (arg != null)
            {
                data = null;

                data = arg as LoadingLockData;

                Text.text = data.mes;

                await Task.Delay(data.timeOut * 1000);

                Game.PopupComponent.CloseLoadingLockUI();

                data.timeOutAction();
            }
        }