Skip to main content

BookRestrictor

A class in Root.Township, Alta.Pages.

Server: keeps a book of one page collection tied to a spot, spawning the book if missing and sending it back when a linked fire is lit.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Book bookOnServerThe book being kept here.
private Book bookPrefabBook prefab spawned if there is none.
private PageCollection collectionPage collection the book holds; saved.
private Fire summoningFireOptional fire that calls the book back when lit.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: finds or spawns the book, registers and docks it, and hooks the summoning fire.
1 private and internal method
MemberWhat it is
private void CheckFireSummon(bool isLit)When the summoning fire is lit and nobody holds the book, returns the book to its spot with an effect.