Class ProjectPlayerSettingsEditorGUILayout
Provides a set of static methods for rendering a toggleable IMGUI-based tab UI in the Unity Editor, allowing users to switch between "Editor" and "Player" configuration views within a custom settings panel.
public sealed class ProjectPlayerSettingsEditorGUILayout
Inheritance
Examples
Example on how to use the layout in an custom Editor:
bool isEditorSelected = ProjectPlayerSettingsEditorGUILayout.BeginEditorPlayerSelectionGrouping();
if (isEditorSelected)
{
// Draw Editor-specific settings
}
else
{
// Draw Player-specific settings
}
ProjectPlayerSettingsEditorGUILayout.EndEditorPlayerSelectionGrouping();
Remarks
This is typically used in custom inspector or editor window UIs where both Editor-only and Player-related settings are grouped in the same panel. It renders two side-by-side tabs styled like Unity's built-in toolbar tabs, tracks which tab is selected, and helps encapsulate the layout logic for cleaner editor code.
Methods
BeginEditorPlayerSelectionGrouping()
Begins a vertical group with two toggleable tabs for switching between Editor and Player settings.
public static bool BeginEditorPlayerSelectionGrouping()
Returns
bool — True if the Editor tab is selected; otherwise, false (i.e., Player is selected).
EndEditorPlayerSelectionGrouping()
Ends the grouping started by BeginEditorPlayerSelectionGrouping. Should be called after BeginEditorPlayerSelectionGrouping to properly close the layout.
public static void EndEditorPlayerSelectionGrouping()