Search Results for

    Show / Hide Table of Contents

    Class GlobalScroll

    The component synchronizes the scroll position of the ScrollRect uGUI component.

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

    Usage (in the inspector of Unity Editor):

    1. Add this component on the same object as the ScrollRect component. If the component is not found on the same object, you should specify the ScrollRect component in the ScrollRect field.
    2. Set the following to OnValueChanged (Vector2) of the tied ScrollRect component.
    EmissionRuntime Only
    ReferenceSpecify this component in hierarchy
    Function UdonBehaviour.SendCustomEvent (string)
    ArgumentOnScroll

    Fields

    NAME_SCROLL_RECT

    The property name of the ScrollRect component.

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

    position

    The scroll position to synchronize.

    Declaration
    public Vector2 position
    Field Value
    Type Description
    Vector2

    velocity

    The scroll velocity to synchronize.

    Declaration
    public Vector2 velocity
    Field Value
    Type Description
    Vector2

    Methods

    Initialize()

    Initialize the object.

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

    OnScroll()

    The callback when the scroll position is changed.

    Declaration
    public void OnScroll()

    Reset()

    Reset the scroll position to the top.

    Declaration
    public void Reset()

    UpdateView()

    The callback to update the view, e.g. the synchronized scroll position.

    Declaration
    protected override void UpdateView()
    Overrides
    SyncBehaviour.UpdateView()
    In This Article
    Back to top Example Unity documentation