A game about forced loneliness, made by TACStudios
at master 1.2 kB view raw
1using UnityEditor; 2using UnityEngine; 3 4namespace Unity.PlasticSCM.Editor.UI.Progress 5{ 6 internal static class DrawProgressForDialogs 7 { 8 internal static void For(ProgressControlsForDialogs.Data data) 9 { 10 Rect rect = GUILayoutUtility.GetRect( 11 GUILayoutUtility.GetLastRect().width, 30); 12 13 if (!string.IsNullOrEmpty(data.StatusMessage)) 14 { 15 EditorGUI.HelpBox(rect, data.StatusMessage, data.StatusType); 16 return; 17 } 18 19 if (data.IsWaitingAsyncResult) 20 DoProgressBar(rect, data.ProgressMessage, data.ProgressPercent); 21 } 22 23 static void DoProgressBar( 24 Rect rect, 25 string progressMessage, 26 float progressPercent) 27 { 28 Rect messageRect = new Rect( 29 rect.xMin, rect.yMin + 2, rect.width, 16); 30 Rect progresRect = new Rect( 31 rect.xMin, rect.yMin + 20, rect.width, 6); 32 33 GUI.Label(messageRect, progressMessage); 34 35 EditorGUI.ProgressBar(progresRect, progressPercent, string.Empty); 36 } 37 } 38}