Paginator

Important

ScrollRect.Content anchors should be setted to top left corner.

How to select paginator

  • If you need paginator with fixed items quantity per page use ListViewPaginator.

  • If you need paginator where the page size is equal ScrollRect size use ScrollRectPaginator. Add TileViewScrollRectFitter if you also need the whole number of items on one page.

  • Use ScrollRectPaginator for any ScrollRect outside ListView, TileView etc.

Options

  • ScrollRect ScrollRect

    ScrollRect to work with.

  • Default Page RectTransform optional

    Template GameObject to display inactive pages.

  • Active Page RectTransform optional

    Template GameObject to display active page.

  • Prev Page RectTransform optional

    GameObject, go to the previous page.

  • Next Page RectTransform optional

    GameObject, go to the next page.

  • Direction PaginatorDirection

    Scroll direction.

    • Auto detect direction by ScrollRect settings and ScrollRect.content size.

    • Horizontal scroll in the horizontal direction

    • Vertical scroll in the vertical direction

  • Fast Drag Distance float

    Scroll to the next or previous page if drag distance more than Fast Drag Distance and drag time less than Fast Drag Time. Set zero to disable.

  • Fast Drag Time float

    Scroll to the next or previous page if drag distance more than Fast Drag Distance and drag time less than Fast Drag Time. Set zero to disable.

  • Forced Position PaginatorPagePosition

    Automatically scroll to the nearest page after drag ended if not meet Fast Drag condition.

    • None automatical scroll disabled

    • OnStart automatical scroll enabled; page aligned by the left side of the ScrollRect (or the top side if scroll in the vertical direction)

    • OnCenter automatical scroll enabled; page aligned by the center side of the ScrollRect

    • OnEnd automatical scroll enabled; page aligned by the right side of the ScrollRect (or the bottom side if scroll in the vertical direction)

  • Animation bool

    Enable animation.

  • Current Page int

    Default page.

Events

  • OnPageSelect UnityEvent<int>

ScrollRectPaginator Options

  • Page Size Type PageSizeType

    If Page Size Type = Auto page size is equal to scroll rect size, if Page Size Type = Fixed will be used Page Size value.

    • Auto

    • Fixed

  • Page Size float

    Size of the page.

  • Page Spacing float

    Space between pages.

  • Movement AnimationCurve

    Animation curve.

  • Unscaled Time bool

    Run animation with unscaled time.

ListViewPaginator Options

  • PerPage int

    Items count on one page, for TileView this is rows or columns count per page.

ListViewPaginator works with ListLiew, TileView (in this case PerPage is rows or columns count) and TreeView. ListView animation settings used if animation enabled.

Animation

Animation work with AnimationCurve. Width is the length of the animation in seconds; height is a relative distance (0 is start position; 1 is end position).

ScrollRectPaginator use own Movement field. ListViewPaginator uses ListView.ScrollMovement field.

Tile View ScrollRect Fitter

Component to resize ListView.ScrollRect to fit the whole number of columns and rows.