Class GlobalToggle
The component synchronizes the selection state of the Toggle UI component.
Inherited Members
Namespace: black.kit.toybox
Assembly: cs.temp.dll.dll
Syntax
public sealed class GlobalToggle : SyncBehaviour
Remarks
Usage (in the inspector of Unity Editor):
-
Add this component on the same object as the Toggle component.
If the component is not found on the same object, you should
specify the Toggle component in the
Toggle
field. -
Set the following to
OnValueChanged (Boolean)
of the tied Toggle component.
Emission | Runtime Only |
Reference | Specify this component in hierarchy |
Function |
UdonBehaviour.SendCustomEvent (string)
|
Argument | OnToggle |
Fields
NAME_TOGGLE
The property name of the Toggle component.
Declaration
public const string NAME_TOGGLE = ""
Field Value
Type | Description |
---|---|
System.String |
value
The value to synchronize.
Declaration
public bool value
Field Value
Type | Description |
---|---|
System.Boolean |
Methods
Initialize()
Initialize the object.
Declaration
protected override void Initialize()
Overrides
OnToggle()
The callback when the value is changed.
Declaration
public void OnToggle()
SetValue(Boolean)
Set the value to the toggle.
Declaration
public void SetValue(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value to set. |
UpdateView()
The callback to update the view, e.g. on synchronized the value.
Declaration
protected override void UpdateView()