API
Public methods and their functionality.
ScrollSnap.cs

Content
Container for scroll snap pages.
ScrollSnapAxis
Axis of the pages. Can be set Horizontal or Vertical.
VerticalPageAlignment
Align the start of the pages to the top or to the bottom of the Content.
HorizontalPageAlignment
Align the start of the pages to the left side or to the right side of the Content.
ScrollOutMargin
Size of the side areas in pixels to scroll out of the first and the last pages. Used for giving an elastic feeling to the scrollable area.
Scroll out margins are shown with orange gizmos on the ScrollSnap component. Changing the value of it will be reflected immediately to let you know how far you can scroll out. The default value is 100 pixels.

SnapAreaSize
The size of the center area in pixels which is necessary for activating the snap. If the next page enters this range page will snap. The default value is 200 pixels.
The snap area is shown with blue gizmos on the ScrollSnap component. Changing the value of it will be reflected immediately to let you know when snap will be active. The default value is 200 pixels.

SnapSpeed
Speed of the snap after swipe gesture stops. The min value is 0 and the max value is 1.
CurrentPageIndex
Index of the current page in the Content.
ScrollAmount
Amount of the scroll from 0 to the number of pages.
OnPageChanged
The Event is called when the page changes. Gives the changed index as a parameter to the callback.
PageWidth
Width of the ScrollSnap page.
PageHeight
Height of the ScrollSnap page.
ResetScrollSnapUI
Resets the page size and position. Should be called if the page count is changed during runtime.
ScrollSnapInfinite.cs

Scroll Snap Infinite is a separate component for infinite scroll ability. API of this class is almost identical to the ScrollSnap component. However, it does not have the ScrollOutMargin variable since it is not needed.
IndexTable.cs

Index Table is a helper component that creates radio button-like behavior for switching pages. Buttons on it are auto-generated for the number of pages in the Scroll Snap component. It can only be used with the Scroll Snap component and not with infinite scroll.

ScrollSnap
The parent Scroll Snap component, that the Index Table will work with.
ToggleSize
The size of the Toggle by height.
TogglePadding
The padding between the buttons of the Index Table.
Last updated
Was this helpful?