Class Options
Used to manage user interface elements for a generator.
Namespace: Global
Assembly: cs.temp.dll.dll
Syntax
public class Options
Fields
dropdowns
The dropdown elements.
Declaration
protected List<Dropdown> dropdowns
Field Value
Type | Description |
---|---|
List<Dropdown> |
inputFields
The input field elements.
Declaration
protected List<InputField> inputFields
Field Value
Type | Description |
---|---|
List<InputField> |
sliders
The sliders elements.
Declaration
protected List<Slider> sliders
Field Value
Type | Description |
---|---|
List<Slider> |
terrainType
All options need to know the terrain type.
Declaration
protected static TerrainGenerator.TerrainType terrainType
Field Value
Type | Description |
---|---|
TerrainGenerator.TerrainType |
toggleOptions
The game objects containing options to be enabled/disabled by a corresponding toggle.
Declaration
protected List<GameObject> toggleOptions
Field Value
Type | Description |
---|---|
List<GameObject> |
toggles
The toggle elements.
Declaration
protected List<Toggle> toggles
Field Value
Type | Description |
---|---|
List<Toggle> |
Methods
setupDropdown(Dropdown, List<String>)
Common setup tasks to be done for dropdowns.
Declaration
protected void setupDropdown(Dropdown dropdown, List<string> options)
Parameters
Type | Name | Description |
---|---|---|
Dropdown | dropdown | The dropdown to be setup. |
List<String> | options | The options to be added to the dropdown element. |
setupSlider(Slider, InputField, Int32, Int32)
Common setup tasks to be done for sliders.
Declaration
protected void setupSlider(Slider slider, InputField input, int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
Slider | slider | The slider to be setup. |
InputField | input | The corresponding input field for the slider. Shows the slider value and can modify it. |
Int32 | minValue | The minimum possible value for the slider. |
Int32 | maxValue | The maximum possible value for the slider. |
setupToggleWithOption(Toggle, GameObject)
Common setup tasks to be done for toggles which enabled/disable a set of options.
Declaration
protected void setupToggleWithOption(Toggle toggle, GameObject optionPanel)
Parameters
Type | Name | Description |
---|---|---|
Toggle | toggle | The toggle to be setup. |
GameObject | optionPanel | The options panel whose active state is affected by the toggle. |
toggleOption(Toggle, GameObject)
Called by the toggle's on value changed event when the toggle is enabled or disabled. Changes the state of the toggle's corresponding options panel.
Declaration
public void toggleOption(Toggle toggle, GameObject optionPanel)
Parameters
Type | Name | Description |
---|---|---|
Toggle | toggle | The toggle which called the method. |
GameObject | optionPanel | The options panel whose active state is affected by the toggle. |
updateInputField(Slider, InputField)
Called by the sliders onValueChanged event to update the corresponding input field with the sliders value when it is changed.
Declaration
public void updateInputField(Slider slider, InputField input)
Parameters
Type | Name | Description |
---|---|---|
Slider | slider | The slider which called the method. |
InputField | input | The slider's corresponding input field. |
updateSlider(InputField, Slider)
Called by the input fields onEndEdit event to ensure the input is valid and the slider matches the input field value.
Declaration
public void updateSlider(InputField input, Slider slider)
Parameters
Type | Name | Description |
---|---|---|
InputField | input | The input field which called the method. |
Slider | slider | The input field's corresponding slider. |