Skip to content

Commit

Permalink
Add IMGUIUtils.EmptyLayoutOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Jan 4, 2024
1 parent 97a4d01 commit 49eb714
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Shared.Core/Utilities/IMGUIUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,12 @@ public static void DrawTooltip(Rect area, int tooltipWidth = 400)
GUI.Box(new Rect(x, y, tooltipWidth, height), GUI.tooltip, _tooltipStyle);
}
}

/// <summary>
/// Empty GUILayoutOption array. You can use this instead of nothing to avoid allocations.
/// For example: <code>GUILayout.Label("Hello world!", IMGUIUtils.EmptyLayoutOptions);</code>
/// At that point you might also want to use GUIContent (created once and stored) instead of string.
/// </summary>
public static GUILayoutOption[] EmptyLayoutOptions = new GUILayoutOption[0];
}
}

0 comments on commit 49eb714

Please sign in to comment.