Method AddSliderControl
AddSliderControl(string, float, UnityAction<float>)
Creates a new slider control with the passed in name and default value. The slider's value runs from 0 to 1. The passed in listener will be called on slider changes. If anything goes wrong this method will return null. Returns the control panel element upon a successful add.
Declaration
public GameObject AddSliderControl(string name, float defaultValue, UnityAction<float> listener)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the slider control |
| float | defaultValue | The default value of the slider, between 0 and 1 |
| UnityAction<float> | listener | The callback action that will be triggered when the slider's value changes |
Returns
| Type | Description |
|---|---|
| GameObject | The created slider |