private IEnumerator ShowSpinnerForDuration() { // Create spinner dialog var spinner = AGProgressDialog.CreateSpinnerDialog("Spinner", "Call Dismiss() to cancel", AGDialogTheme.Dark); spinner.Show(); // Spin for some time (do important work) yield return(new WaitForSeconds(3.0f)); // Dismiss spinner after all the background work is done spinner.Dismiss(); }
private IEnumerator ShowHorizontalForDuration() { const int dialogMaxProgress = 200; // Create progress bar dialog var progressBar = AGProgressDialog.CreateHorizontalDialog("Progress bar", "Call Dismiss() to cancel", dialogMaxProgress); progressBar.Show(); const float progressDuration = 3.0f; float currentProgress = 0f; // Display incremental progress while (currentProgress < progressDuration) { currentProgress += Time.deltaTime; int progress = Mathf.CeilToInt((currentProgress / progressDuration) * dialogMaxProgress); progressBar.SetProgress(progress); yield return(null); } // Dismiss spinner after all the background work is done progressBar.Dismiss(); }
public ProgressDialogSpinner(string title, string message) { #if UNITY_ANDROID && !UNITY_EDITOR _progressSpinner = AGProgressDialog.CreateSpinnerDialog(title, message, AGDialogTheme.Dark); #endif }
//--------------------------------------------------------------------- // Public //--------------------------------------------------------------------- public ProgressDialogSpinner() { #if UNITY_ANDROID && !UNITY_EDITOR _progressSpinner = AGProgressDialog.CreateSpinnerDialog("", "", AGDialogTheme.Default); #endif }