-
Notifications
You must be signed in to change notification settings - Fork 10
Runtime Configuration Menu
GniLudio edited this page May 26, 2023
·
1 revision
The Runtime Configuration Menu is a menu so that the setting of code cities can be changed during runtime.
It can be opened through the shortcut K.
All public attributes are automatically displayed in the menu.
To specify the tab in which the attribute appears, it needs to be annotated with the RuntimeTab attribute.
[Tooltip("Settings for the edge layout."), TabGroup(EdgeFoldoutGroup), RuntimeTab(EdgeFoldoutGroup)]
public EdgeLayoutAttributes EdgeLayoutSettings = new();
Remarks:
- Only attributes directly inside a
city-class need to be annotated.- nested attributes are automatically added inside the same tab
- without a
RuntimeTabattribute it will be added to theMisctab
- The attribute
TabGroupspecifies the tab group in the unity editor.
To create a configuration button on the right side of the menu a method can be annotated with the RuntimeButtonAttribute.
[Button(ButtonSizes.Small)]
[ButtonGroup(ConfigurationButtonsGroup), RuntimeButton(ConfigurationButtonsGroup, "Load Configuration")]
[PropertyOrder(ConfigurationButtonsGroupLoad)]
public void LoadConfiguration()
{
Load(ConfigurationPath.Path);
}