Scroll Rect default event – On Value Changed (Vector2)

The Scroll Rect component's default event is the On Value Changed event, as seen in the On Value Changed (Vector2) section of the Scroll Rect component. This event will trigger whenever the Content area of the Scroll View is moved by dragging, scrolling with the mouse scroll wheel, or scrolling with one of the scrollbars. It accepts a Vector2 position as an argument and, as with the other events discussed in this chapter, you can choose to pass no argument, a static argument, or a dynamic argument.

If you want to send the Vector2 position of Content to a function, you'd send it to a function with a Vector2 parameter from the Dynamic Vector2 list. The position sent is essentially a percentage, ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.