A class in Root.Township, Alta.Meta.UI.
Menu popup that shows a message and a column of option buttons; pressing one runs its action and closes the panel.
Constructors
| Member | What it is |
|---|
OptionsPanel() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private OptionsPanelButtonConfig[] buttonConfig | Button prefab for each button type. |
private List<GameObject> currentButtons | Buttons made by the last Setup. |
private Transform parent | Where buttons are created. |
private GameObject smallBackground | Background for two options or fewer. |
private float spacing | Vertical gap between buttons. |
private GameObject tallBackground | Background for more than two options. |
private TextRenderer text | Text for the message. |
Methods
| Member | What it is |
|---|
void Setup(IEnumerable<OptionsConfig> optionsConfig, string message = null) | Builds a button per option with the right prefab and the message, using the tall background for more than two options. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Uses its own transform as the button parent if none is set. |
private Button GetPrefab(UIButtonType type) | Returns the button prefab for a button type. |
private void ResetButtons() | Destroys the current buttons and hides the panel. |
Used in
Members of other types that take, return or hold a OptionsPanel: