Merge branch 'main-menu-get-add' of https://github.com/Tryibion/FlaxEngine into Tryibion-main-menu-get-add

This commit is contained in:
Wojtek Figat
2025-06-15 20:36:32 +02:00

View File

@@ -266,6 +266,19 @@ namespace FlaxEditor.GUI
return AddChild(new MainMenuButton(text)); return AddChild(new MainMenuButton(text));
} }
/// <summary>
/// Gets or adds a button.
/// </summary>
/// <param name="text">The button text</param>
/// <returns>The existing or created button control.</returns>
public MainMenuButton GetOrAddButton(string text)
{
MainMenuButton result = GetButton(text);
if (result == null)
result = AddButton(text);
return result;
}
/// <summary> /// <summary>
/// Gets the button. /// Gets the button.
/// </summary> /// </summary>