Search Results for

    Show / Hide Table of Contents

    Class GlobalToggles

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

    Inheritance
    System.Object
    SyncBehaviour
    GlobalToggles
    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 GlobalToggles : SyncBehaviour
    Remarks

    Usage (in the inspector of Unity Editor):

    1. Add this component on the same object as the ToggleGroup component. If the component is not found on the same object, you should specify the ToggleGroup component in the ToggleGroup field.
    2. Set the following to OnValueChanged (Boolean) in each Toggle component associated with the ToggleGroup component.
    EmissionRuntime Only
    ReferenceSpecify this component in hierarchy
    Function UdonBehaviour.SendCustomEvent (string)
    ArgumentOnValueChanged

    Fields

    index

    The value to synchronize.

    Declaration
    public sbyte index
    Field Value
    Type Description
    System.SByte
    Remarks

    The value is the index of the selected toggle. When the value is -1, no toggle is selected.

    NAME_TOGGLE_GROUP

    The property name of the toggle group component.

    Declaration
    public const string NAME_TOGGLE_GROUP = ""
    Field Value
    Type Description
    System.String

    NAME_TOGGLES

    The property name of the toggle component.

    Declaration
    public const string NAME_TOGGLES = "toggles"
    Field Value
    Type Description
    System.String

    Methods

    Initialize()

    Initialize the object.

    Declaration
    protected override void Initialize()
    Overrides
    SyncBehaviour.Initialize()

    OnValueChanged()

    The callback when the value is changed.

    Declaration
    public void OnValueChanged()

    SetValue(SByte)

    Declaration
    public void SetValue(sbyte index)
    Parameters
    Type Name Description
    System.SByte index

    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