示例#1
0
        internal async Task CurrentPageChangedAsync(int page)
        {
            CurrentPage = page;
            if (CurrentPageChanged.HasDelegate)
            {
                RequireRender = true;
                var option = new LoadingOption()
                {
                    Background = LoadingBackground,
                    Target     = Container,
                    IconClass  = LoadingIconClass,
                    Text       = LoadingText
                };
                LoadingService.LoadingOptions.Add(option);
                SelectedRows.Clear();
                await CurrentPageChanged.InvokeAsync(page);

                LoadingService.LoadingOptions.Remove(option);
            }
        }
示例#2
0
        async Task ShowFullScreenLoadingAsync(LoadingOption option)
        {
            await Document.AppendAsync(option.Element);

            await Document.DisableScrollAsync();

            var style = option.Element.Dom(JSRuntime).Style;
            await style.SetAsync("display", "none");

            await style.SetAsync("width", "100%");

            await style.SetAsync("height", "100%");

            await style.SetAsync("position", "fixed");

            await style.SetAsync("top", "0");

            await style.SetAsync("bottom", "0");

            await style.SetAsync("display", "block");
        }
示例#3
0
        public override async Task <AssetRef> LoadAsync(string path, TYPE type, LoadingOption option, string assetBundlePath)
        {
            path = Core.Path.instance.Resolve(path, TYPE.Prefab);
            var asset  = AssetDatabase.LoadAssetAtPath <GameObject>(path);
            var result = await Loading.instance.Wrap(async() =>
            {
                await Observable.TimerFrame(1);
                option.progress?.Invoke(1.0f);
                return(true);
            }, option);

            if (!result)
            {
                return(null);
            }

            var assetRef = new AssetRef(path, asset);
            await Observable.TimerFrame(1);

            return(assetRef);
        }
示例#4
0
        protected override async Task <AssetBundle> LoadAssetBundleSingleAsync(string path, LoadingOption option, float weight = 1.0f)
        {
            Log.Resource.I("Local LoadAssetBundleSingleAsync {0}", path);
            var createRequest = AssetBundle.LoadFromFileAsync(path);
            var result        = await Loading.instance.Wrap(
                async() => { return(await HookProgress(createRequest, option.progress, weight)); }, option);

            if (!result)
            {
                return(null);
            }

            return(createRequest.assetBundle);
        }
示例#5
0
 async Task CloseFullScreenLoadingAsync(LoadingOption option)
 {
     await Document.EnableYScrollAsync();
 }