Merge branch 'main-menu-get-add' of https://github.com/Tryibion/FlaxEngine into Tryibion-main-menu-get-add
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user