/// <summary> Displays a progress UI that is blocking so that the user cant do input /// while the progress is showing, useful for loading screens etc </summary> private async Task SetupBlockingProgressButton() { await gameObject.GetLinkMap().Get <Button>("BlockingProgressButton").SetOnClickAction(async delegate { ProgressManager prManager = new ProgressManager(); ProgressUi progressUi = gameObject.GetViewStack().ShowBlockingProgressUiFor(prManager); IProgress progress = prManager.GetOrAddProgress("DemoLoadingProgress", 200, true); await SimulateProgressOn(progressUi, progress, 15); AssertV2.IsTrue(progressUi.IsDestroyed(), "Blocking progress not destroyed after it completed"); }); }
/// <summary> Displays a progress UI that is blocking so that the user cant do input /// while the progress is showing, useful for loading screens etc </summary> private async Task SetupBlockingProgressButton() { await gameObject.GetLinkMap().Get <Button>("BlockingProgressButton").SetOnClickAction(async delegate { ProgressManager prManager = new ProgressManager(); ProgressUi progressUi = gameObject.GetViewStack().ShowBlockingProgressUiFor(prManager); IProgress progress = prManager.GetOrAddProgress("DemoLoadingProgress", 200, true); progressUi.progressDetailsInfoText?.textLocalized("I am a progress UI, I hope I wont take to long!"); for (int i = 0; i < progress.totalCount - 1; i++) { progress.IncrementCount(); await TaskV2.Delay(15); } progressUi.progressDetailsInfoText?.textLocalized("The last % is always the hardest!"); await TaskV2.Delay(2000); progress.IncrementCount(); await TaskV2.Delay(15); AssertV2.IsTrue(progressUi.IsDestroyed(), "Blocking progress not destroyed after it completed"); }); }