Layout
Page Manager
Swipe or navigate between full UI pages
Overview
Page Manager arranges content pages and transitions between them using swipes or explicit navigation. It's a gesture-based version of the Tab Manager component.
Usage
Add Page Manager and populate its Pages list.
Assign the container and optional indicator.
Choose horizontal or vertical swipe direction.
Tips
- Adjust swipe distance and velocity thresholds, elastic resistance, spacing, and the transition curve.
- Handle Nested Scrolling helps coordinate swipes with scrollable content inside a page.
Public API
Use PageManager in the Evo.UI namespace.
Properties
| Name | Type | Description |
|---|---|---|
CurrentPageIndex | int | Active page index. |
CurrentPage | Page | Active page, or null. |
IsTransitioning | bool | Whether a page animation is running. |
HandleNestedScrolling | bool | Coordinates drag input with nested scrolling. |
Fields
| Name | Type | Description |
|---|---|---|
pages | List<Page> | Page definitions. |
disableInvisiblePages | bool | Disables pages outside the active view. |
Methods
| Name | Parameters | Description |
|---|---|---|
OpenPage() | int index, bool animate = true | Opens a page by index, with optional animation. |
OpenPage() | int index | Opens a page by index with animation. |
OpenNextPage() | None | Opens the next valid page. |
OpenPreviousPage() | None | Opens the previous valid page. |
PositionPages() | None | Updates page layout. |
RefreshIndicator() | None | Updates the current-page indicator. |
BeginPagesEdit() | None | Begins a batch of page-list changes. |
EndPagesEdit() | None | Finishes the batch and refreshes. |
Events
| Name | Type | Description |
|---|---|---|
onPageChanged | UnityEvent<int> | Invoked with the current page index. |
Example
using UnityEngine;
using Evo.UI;
public class PageManagerExample : MonoBehaviour
{
[SerializeField] private PageManager target;
private void Start()
{
// Configure pages in the Inspector; start on the first without a transition.
target.OpenPage(0, animate: false);
target.onPageChanged.AddListener(index => Debug.Log($"Page {index}"));
}
// Connect navigation buttons to these methods.
public void NextPage() => target.OpenNextPage();
public void PreviousPage() => target.OpenPreviousPage();
}