Hi all,
I’m having Unity crash whenever it shows a progress bar on OSX. Including when trying to build. I get the exact same call stack as in this issue, however it was marked as not reproducible. On Windows there are no issues.
public class MapGeneratorProgressBar : EditorWindow {
public static bool IsRunning;
public static int CompletedSprites;
public static int TotalSprites;
public static string ProgressDescription;
static double Progress { get { return (double)CompletedSprites / TotalSprites; }}
public static void Show(int total) {
IsRunning = true;
CompletedSprites = 0;
TotalSprites = total;
GetWindow().Show();
}
static EditorWindow GetWindow() {
EditorWindow window = GetWindow(typeof(MapGeneratorProgressBar));
window.minSize = window.maxSize = new Vector2(1, 1);
Rect position = window.position;
position.center = new Rect(0f, 0f, Screen.currentResolution.width, Screen.currentResolution.height).center;
window.position = position;
return window;
}
void OnGUI() {
if (!IsRunning || Progress >= 1) {
IsRunning = false;
EditorUtility.ClearProgressBar();
GetWindow().Close();
EditorApplication.Beep();
EditorUtility.DisplayDialog("Complete", "Map generation has completed.", "OK");
return;
}
if (EditorUtility.DisplayCancelableProgressBar("Generating Map", ProgressDescription, (float)Progress)) {
IsRunning = false;
}
}
void Update() {
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
}
The crash happens after I press “OK” on the dialog when complete. So I can still save my scene before pressing it. However I am currently unable to build from my OSX installation.
Is anyone else experiencing this? I was getting it in 2017.3.0 and just tried upgrading to 2017.3.1 however the issue remains.