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); } }
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"); }
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); }
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); }
async Task CloseFullScreenLoadingAsync(LoadingOption option) { await Document.EnableYScrollAsync(); }