Class UISetting
Superclass of all implemented settings (like dropdowns, toggles, text boxes, etc.). Used together with the setting prefab GameObjects.
Inheritance
Namespace: AS2.UI
Assembly: .dll
Syntax
public abstract class UISetting
Fields
| Edit this page View SourcebackgroundButton_onButtonPressedEvent
Declaration
public Action<string> backgroundButton_onButtonPressedEvent
Field Value
Type | Description |
---|---|
Action<string> |
backgroundButton_onButtonPressedLongEvent
Declaration
public Action<string, float> backgroundButton_onButtonPressedLongEvent
Field Value
Type | Description |
---|---|
Action<string, float> |
button
Declaration
protected Button button
Field Value
Type | Description |
---|---|
Button |
buttonBackgroundImage
Declaration
protected Image buttonBackgroundImage
Field Value
Type | Description |
---|---|
Image |
buttonHoldEnabled
Declaration
protected bool buttonHoldEnabled
Field Value
Type | Description |
---|---|
bool |
buttonTrigger
Declaration
protected ButtonHoldTrigger buttonTrigger
Field Value
Type | Description |
---|---|
ButtonHoldTrigger |
go
Declaration
protected GameObject go
Field Value
Type | Description |
---|---|
GameObject |
locked
Declaration
protected bool locked
Field Value
Type | Description |
---|---|
bool |
name
Declaration
protected string name
Field Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceClear()
Clears the callback events of the setting.
Declaration
public void Clear()
ClearRefs()
Clears all subclass-specific callback events.
Declaration
protected abstract void ClearRefs()
DisableButtonHold()
Disables the background button hold feature.
Declaration
public void DisableButtonHold()
EnableButtonHold()
Enables the background button hold feature.
Declaration
public void EnableButtonHold()
GetBackgroundButton()
Declaration
public Button GetBackgroundButton()
Returns
Type | Description |
---|---|
Button |
GetGameObject()
Declaration
public GameObject GetGameObject()
Returns
Type | Description |
---|---|
GameObject |
GetName()
Declaration
public string GetName()
Returns
Type | Description |
---|---|
string |
GetValueString()
Access to the current value.
Declaration
public abstract string GetValueString()
Returns
Type | Description |
---|---|
string | The current value of the setting as a string. |
InitBackgroundButton()
Declaration
protected void InitBackgroundButton()
InteractiveBarUpdate()
Call this each frame if you want support for the interactive bar.
Declaration
public void InteractiveBarUpdate()
Lock(bool)
Locks the setting so that its value cannot be changed anymore.
Declaration
public void Lock(bool lockButton = true)
Parameters
Type | Name | Description |
---|---|---|
bool | lockButton | Indicates whether the background button should be locked as well. |
LockSetting()
Locks the setting to prevent changes.
Declaration
protected abstract void LockSetting()
OnButtonPressed()
Declaration
private void OnButtonPressed()
OnButtonPressedLong(float)
Declaration
private void OnButtonPressedLong(float duration)
Parameters
Type | Name | Description |
---|---|---|
float | duration |
SetInteractable(bool, bool)
Sets the interactable state of the setting and its background button.
Declaration
public void SetInteractable(bool interactable, bool backgroundInteractable = true)
Parameters
Type | Name | Description |
---|---|---|
bool | interactable | The new interactable state of the setting. |
bool | backgroundInteractable | The new interactable state of the button. |
SetInteractableState(bool)
Sets the setting's interactable state.
Declaration
protected abstract void SetInteractableState(bool interactable)
Parameters
Type | Name | Description |
---|---|---|
bool | interactable | The new interactable state. |
SetValueString(string)
The inverse of GetValueString(). If calling both methods after each other, nothing should change.
Declaration
public abstract void SetValueString(string input)
Parameters
Type | Name | Description |
---|---|---|
string | input | String representation of the setting's new value. |
Unlock(bool)
Unlocks the setting so that its value can be changed again.
Declaration
public void Unlock(bool unlockButton = true)
Parameters
Type | Name | Description |
---|---|---|
bool | unlockButton | Indicates whether the background button should be unlocked as well. |
UnlockSetting()
Unlocks the setting to allow changes again after locking.
Declaration
protected abstract void UnlockSetting()