IProgressIndicator.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Threading.Tasks;
  2. using UnityEngine;
  3. namespace SC.XR.Unity
  4. {
  5. public interface IProgressIndicator
  6. {
  7. /// <summary>
  8. /// Used to determine whether it's appropriate to use this indicator.
  9. /// </summary>
  10. ProgressIndicatorState State { get; }
  11. /// <summary>
  12. /// Loading progress value from 0 (just started) to 1 (complete)
  13. /// </summary>
  14. float Progress { get; set; }
  15. /// <summary>
  16. /// Opens the progress indicator before loading begins. Method is async to allow for animation to begin before loading.
  17. /// </summary>
  18. Task OpenAsync();
  19. /// <summary>
  20. /// Returns after progress indicator completes its opening or closing transition.
  21. /// </summary>
  22. Task AwaitTransitionAsync();
  23. /// <summary>
  24. /// Closes the progress indicator after loading is finished. Method is async to allow for animation to complete.
  25. /// </summary>
  26. Task CloseAsync();
  27. /// <summary>
  28. /// Set the progress value of the progress indicator.
  29. /// </summary>
  30. void SetProgress(float progress);
  31. }
  32. }