Search Results for

    Show / Hide Table of Contents

    Class GlobalToggle

    The component synchronizes the selection state of the Toggle UI component.

    Inheritance
    System.Object
    SyncBehaviour
    GlobalToggle
    Inherited Members
    SyncBehaviour.NAME_SUBJECT
    SyncBehaviour.Initialized
    SyncBehaviour.ChangeOwner()
    SyncBehaviour.Sync()
    SyncBehaviour.OnDeserialization()
    SyncBehaviour.OnPlayerJoined(VRCPlayerApi)
    SyncBehaviour.IsOwner()
    SyncBehaviour.OnEnable()
    Namespace: black.kit.toybox
    Assembly: cs.temp.dll.dll
    Syntax
    public sealed class GlobalToggle : SyncBehaviour
    Remarks

    Usage (in the inspector of Unity Editor):

    1. 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.
    2. Set the following to OnValueChanged (Boolean) of the tied Toggle component.
    EmissionRuntime Only
    ReferenceSpecify this component in hierarchy
    Function UdonBehaviour.SendCustomEvent (string)
    ArgumentOnToggle

    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
    SyncBehaviour.Initialize()

    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()
    Overrides
    SyncBehaviour.UpdateView()
    In This Article
    Back to top Example Unity documentation