Skip to content

Commit f5aac69

Browse files
committed
fix: Fixed editor freezing when installing a transport while in compilation
1 parent 82bd361 commit f5aac69

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

MLAPI-Editor/MLAPIEditor.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ private void OnGUI()
474474
boldStyle.normal.textColor = new Color(0.3f, 1f, 0.3f);
475475
EditorGUILayout.LabelField("Installed", boldStyle);
476476

477+
if (EditorApplication.isUpdating || EditorApplication.isCompiling)
478+
{
479+
GUI.enabled = false;
480+
}
481+
477482
// This is installed
478483
if (GUILayout.Button("Reinstall Latest"))
479484
{
@@ -509,13 +514,28 @@ private void OnGUI()
509514
Debug.LogError(e.GetType().FullName);
510515
}
511516
}
517+
518+
if (EditorApplication.isUpdating || EditorApplication.isCompiling)
519+
{
520+
GUI.enabled = true;
521+
}
512522
}
513523
else
514524
{
525+
if (EditorApplication.isUpdating || EditorApplication.isCompiling)
526+
{
527+
GUI.enabled = false;
528+
}
529+
515530
if (GUILayout.Button("Install Latest"))
516531
{
517532
EditorCoroutine.Start(InstallTransport(i));
518533
}
534+
535+
if (EditorApplication.isUpdating || EditorApplication.isCompiling)
536+
{
537+
GUI.enabled = true;
538+
}
519539
}
520540

521541
EditorGUILayout.Space();

0 commit comments

Comments
 (0)