Class PageSlider
The PageSlider class manages a collection of pages within a PageScroller component. It provides functionality for adding, removing, and keeping track of pages, as well as handling page change events.
Inheritance
System.Object
PageSlider
Namespace: TS.PageSlider
Assembly: .dll
Syntax
public class PageSlider : MonoBehaviour
Fields
OnPageChanged
Declaration
public UnityEvent<PageContainer> OnPageChanged
Field Value
| Type | Description |
|---|---|
| UnityEvent<PageContainer> |
Properties
Rect
Gets the rectangle of the PageSlider component.
Declaration
public Rect Rect { get; }
Property Value
| Type | Description |
|---|---|
| Rect |
Methods
AddPage(RectTransform)
Adds a new page to the PageSlider. The content argument specifies the RectTransform of the content to be displayed on the new page.
Declaration
public void AddPage(RectTransform content)
Parameters
| Type | Name | Description |
|---|---|---|
| RectTransform | content | The RectTransform of the content to be displayed on the new page. |
Clear()
Removes all pages from the PageSlider and clears the associated PageDotsIndicator (if exists).
Declaration
public void Clear()