Method AddToggleControl
AddToggleControl(string, UnityAction<bool>)
Creates a new toggle control with passed in name. The passed in listener will be called on toggle clicks. If anything goes wrong this method will return null. Returns the control panel element upon a successful add.
Declaration
public GameObject AddToggleControl(string name, UnityAction<bool> listener)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the toggle |
| UnityAction<bool> | listener | The callback action that will be triggered when the toggle's state changes |
Returns
| Type | Description |
|---|---|
| GameObject | The created toggle |