Skip to main content

GeneratedPageProvider<T>

An abstract class in Root.Township, the global namespace.

Base for a page provider that builds a page from a hashed asset (for example an effect or recipe), saving only the asset's hash.

Constructors​

MemberWhat it is
protected GeneratedPageProvider()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Methods​

MemberWhat it is
abstract PageData GeneratePage(T from)Subclass: builds page data for an asset.
override PageData Load(PageInstanceSaveData saveData)Rebuilds a page from the saved asset hash.
override void Save(PageInstanceSaveData saveData, PageData page)Saves the provider id and the asset's hash.
protected static void GenerateCircleSegments(PageData pageData, GlyphPosition glyphPosition, int numberOfSegments, float segment1Scale, float segment10Scale)Adds circle segment glyphs to show a number, a big segment per 10 and a small one per unit.
protected static void GenerateEffectAndBorder(PageData pageData, Glyph effectGlyph, Glyph borderGlyph, GlyphPosition glyphPosition, float borderScale)Adds an effect glyph and a border glyph around it.