Admin Panel

SCILLPagination

public class SCILLPagination : MonoBehaviour

Overview

This class handles pagination for the SCILLBattlePassLevels class. Not all levels fit into the screen, so they are paginated. Use this class to manage that.

This class offers two types of pagination. Via forward and backward buttons. And via pagination dots, where each dot stands for one page. This allows the user to quickly navigate to pages further away.

Inspector properties

itemsPerPage

public int itemsPerPage = 5;

Often, the number of levels available in a battle pass cannot be rendered at once on the screen. Use this setting to set the number of levels shown at once. Connect the prevButton and nextButton to implement pagination functionality.

prevButton

public Button prevButton;

Connect a button which will be used to navigate to the previous page. It will be hidden if there is no previous page.

nextButton

public Button nextButton;

Connect a button which will be used to navigate to the next page. It will be hidden if user has navigated to the last available page.

pageText

public Text pageText;

A UnityEngine.UI.Text field which is used to set show the user the current navigation state, i.e. Page 1/10

paginationContainer

public Transform paginationContainer;

Connect a transform that will be used as a container for the dots. Use HorizontalLayoutGroup for automatic layout on that container.

dotButtonActivePagePrefab

public GameObject dotButtonActivePagePrefab;

A prefab that will be used to render an active dot in the pagination dots list.

dotButtonPrefab

public GameObject dotButtonPrefab;

A prefab that will be used to render an inactive dot in the pagination dots list. This prefab must have a Button component attached, but you do not need to attach a click event, as this class adds a listener to the correct internal click handler function.