Skip to main content

GenericCraftingRecipePageProvider

A class in Root.Township, the global namespace.

Page provider (ID 2) that draws a generic crafting recipe as a page: result item glyph plus one glyph and count per material. Get it with Instance.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private GenericCraftingRecipe testRecipeRecipe used by Test.

Properties​

MemberWhat it is
override int Identifier { get; }Provider ID, 2.
static GenericCraftingRecipePageProvider Instance { get; }The registered provider from PageProvider.Providers[2].

Methods​

MemberWhat it is
override PageData GeneratePage(GenericCraftingRecipe recipe)Builds the page from the template, the result item's glyph, the recipe's unique glyphs and a counted glyph per material.
override PageData GetRandom()Picks a random recipe (from the simple list on a simple server) and returns its page if not yet found, else null.
override void Serialize(Stream stream, ref PageData page)Syncs the page as the recipe hash; the reader rebuilds the page from it.
protected override void Test()Editor test: renders testRecipe on the test renderer.