Class UISetting_Dropdown
UISetting subclass for settings that have a fixed number of
possible values, like enums. The setting is represented as a dropdown menu.
Inheritance
UISetting_Dropdown
Namespace: AS2.UI
Assembly: .dll
Syntax
public class UISetting_Dropdown : UISetting
Constructors
Declaration
public UISetting_Dropdown(GameObject go, Transform parentTransform, string name, Enum[] choices, Enum initialChoice)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Transform |
parentTransform |
|
string |
name |
|
Enum[] |
choices |
|
Enum |
initialChoice |
|
Declaration
public UISetting_Dropdown(GameObject go, Transform parentTransform, string name, string[] choices, string initialChoice)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Transform |
parentTransform |
|
string |
name |
|
string[] |
choices |
|
string |
initialChoice |
|
Fields
dropdown
Declaration
private TMP_Dropdown dropdown
Field Value
Type |
Description |
TMP_Dropdown |
|
onValueChangedEvent
Declaration
public Action<string, string> onValueChangedEvent
Field Value
options
Declaration
private List<string> options
Field Value
Methods
ClearRefs()
Clears all subclass-specific callback events.
Declaration
protected override void ClearRefs()
Overrides
GetValueString()
Access to the current value.
Declaration
public override string GetValueString()
Returns
Type |
Description |
string |
The current value of the setting as a string.
|
Overrides
InitDropdown(string[], string)
Declaration
protected void InitDropdown(string[] choices, string initialChoice)
Parameters
LockSetting()
Locks the setting to prevent changes.
Declaration
protected override void LockSetting()
Overrides
OnValueChanged()
Declaration
private void OnValueChanged()
SetInteractableState(bool)
Sets the setting's interactable state.
Declaration
protected override void SetInteractableState(bool interactable)
Parameters
Type |
Name |
Description |
bool |
interactable |
The new interactable state.
|
Overrides
SetValue(Enum)
Declaration
public void SetValue(Enum value)
Parameters
Type |
Name |
Description |
Enum |
value |
|
SetValue(string)
Declaration
public void SetValue(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
SetValueString(string)
The inverse of GetValueString().
If calling both methods after each other, nothing should change.
Declaration
public override void SetValueString(string input)
Parameters
Type |
Name |
Description |
string |
input |
String representation of the setting's new value.
|
Overrides
UnlockSetting()
Unlocks the setting to allow changes again after locking.
Declaration
protected override void UnlockSetting()
Overrides
UpdateValue(string)
Declaration
public void UpdateValue(string value)
Parameters
Type |
Name |
Description |
string |
value |
|