Skip to main content

PageCollection

A class in Root.Township, Alta.Pages.

Asset listing the pages a kind of book can hold, in order. Looked up by hash; a Book uses one to know its pages.

Constructors​

MemberWhat it is
PageCollection()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

6 private and internal fields
MemberWhat it is
private bool canRemovePagesFromBacking field for CanRemovePagesFrom.
private FlairSettings flairsBacking field for Flairs.
private int[] initialPagesIndexes into pageBases for the pages the collection starts with.
private bool isHidingMaxCountBacking field for IsHidingMaxCount.
private Object[] pageBasesPage bases (IPageBasis objects) in the collection; a page's index is its position here.
private int preferredProviderProvider index passed to CreatePage when generating a page.

Properties​

MemberWhat it is
bool CanRemovePagesFrom { get; }If false, pulling a page out of the book makes a duplicate and leaves the page in.
FlairSettings Flairs { get; }Decoration settings for books with this collection.
IEnumerable<Object> InitialPages { get; }Pages every world starts with already unlocked.
bool IsHidingMaxCount { get; }If true, the book's counter shows only pages found, not found out of total.
Object[] PageBases { get; }The page assets in order.
int PreferredProvider { get; }Provider id used when creating page data.
int Size { get; }Number of pages in the collection.

Methods​

MemberWhat it is
PageData GeneratePage(int index)Creates the page data for the page at an index, with the preferred provider.
int IndexOf(Object pageObject)Position of a page asset in the collection, or -1.

Used in​

Members of other types that take, return or hold a PageCollection: