Skip to content

Commit

Permalink
🔧 Fixed GUI.Enabled Issue On Scene Group Loader Window
Browse files Browse the repository at this point in the history
- Fixed an issue where the buttons would not disable on the scene group loader window when the user was running in play mode. The buttons would correctly not function though so not a massive deal.
  • Loading branch information
JonathanMCarter committed Oct 30, 2022
1 parent 9484aba commit c577da1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Editor/Editor Windows/SceneGroupLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void OnGUI()
}

scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
DrawGroupsAndButtons();
DrawGroupsAndButtons(GUI.enabled);
EditorGUILayout.EndScrollView();
}

Expand Down Expand Up @@ -150,7 +150,7 @@ private List<GroupCategory> GetValidCategories(out SceneGroup[] groups)
/// <summary>
/// Draws all the buttons for the scene groups in the categories required.
/// </summary>
private void DrawGroupsAndButtons()
private void DrawGroupsAndButtons(bool isEnabled)
{
EditorGUILayout.Space(4f);

Expand Down Expand Up @@ -200,14 +200,14 @@ private void DrawGroupsAndButtons()
{
if (group.groupCategory.Equals(groupCat.groupName))
{
GUI.enabled = !group.ContainsScene(string.Empty) && group.IsValid;
GUI.enabled = !group.ContainsScene(string.Empty) && group.IsValid && isEnabled;

if (GUILayout.Button(group.buttonLabel.Length > 0 ? group.buttonLabel : group.name))
{
LoadSceneGroupInEditor(group);
}

GUI.enabled = true;
GUI.enabled = isEnabled;
}
}

Expand Down
Binary file not shown.

0 comments on commit c577da1

Please sign in to comment.