Add GetOrAddButton utility for MainMenu.
This commit is contained in:
@@ -266,6 +266,19 @@ namespace FlaxEditor.GUI
|
||||
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>
|
||||
/// Gets the button.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user