Class GlobalScroll
The component synchronizes the scroll position of the ScrollRect uGUI component.
Inherited Members
Namespace: black.kit.toybox
Assembly: cs.temp.dll.dll
Syntax
public sealed class GlobalScroll : SyncBehaviour
Remarks
Usage (in the inspector of Unity Editor):
-
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. -
Set the following to
OnValueChanged (Vector2)
of the tied ScrollRect component.
Emission | Runtime Only |
Reference | Specify this component in hierarchy |
Function |
UdonBehaviour.SendCustomEvent (string)
|
Argument | OnScroll |
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
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()