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