No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EditorProgressBar.cs 1017B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Linq;
  2. using System.Reflection;
  3. namespace Unity.PlasticSCM.Editor.UI
  4. {
  5. internal static class EditorProgressBar
  6. {
  7. static EditorProgressBar()
  8. {
  9. var type = typeof(UnityEditor.Editor).Assembly.GetTypes().Where(
  10. t => t.Name == "AsyncProgressBar").FirstOrDefault();
  11. if (type == null)
  12. return;
  13. mDisplayMethod = type.GetMethod("Display");
  14. mClearMethod = type.GetMethod("Clear");
  15. }
  16. internal static void ShowProgressBar(string text, float progress)
  17. {
  18. if (mDisplayMethod == null)
  19. return;
  20. mDisplayMethod.Invoke(null, new object[] { text, progress });
  21. }
  22. internal static void ClearProgressBar()
  23. {
  24. if (mClearMethod == null)
  25. return;
  26. mClearMethod.Invoke(null, null);
  27. }
  28. static MethodInfo mDisplayMethod = null;
  29. static MethodInfo mClearMethod = null;
  30. }
  31. }