Skip to main content

PaperPageInstance

A class in Root.Township, Alta.Pages.

A physical page item. An original page joins the shared page collection when a player lets go of it; a duplicate copy is not saved and decays when dropped.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private Coroutine decayPrivate: the running decay coroutine.
private float decayDurationSeconds the decay effect plays before the page is destroyed. Defaults to 5.
private EffectReleaseOnFade decayEffectPrivate: the decay effect being played.
private PooledObjectDefinition decayEffectDefinitionPooled effect played while a dropped copy decays.
private float delayToStartDecayingSeconds after a copy is dropped before it starts decaying. Defaults to 1.
private bool isDuplicateBacking field for IsDuplicate.

Properties​

MemberWhat it is
Pickup Pickup { get; }The page's Pickup, from Entity.CommonPickup.
protected override bool IsDuplicate { get; set; }Whether this is a copy. Setting it calls MarkAsDuplicate.

Methods​

MemberWhat it is
void AutoAdd(PlayerController controller)Dissolves the page on clients and, on the server, adds its data to GlobalPagesManager and destroys the item.
override void InitializeAsServer(SpawnData spawnData)Hooks the first grab so original pages can be added on release.
void MarkAsDuplicate(bool isDuplicate)Makes the page a copy (not saved, decays when dropped) or an original (can't be docked, added on release).
protected override void Serialize(Stream stream)Adds the duplicate flag to the page sync. Clients apply it with MarkAsDuplicate.
9 private and internal methods
MemberWhat it is
private void AutoAdd(Interactable interactable, Interactor interactor)Dissolves the page on clients and, on the server, adds its data to GlobalPagesManager and destroys the item.
private void AutoAddCheckOriginal(Interactable arg1, Interactor arg2)Private, server: on first grab of an original page, blocks docking and other hands and adds it on release.
private IEnumerator Decay() (iterator)Private: after the drop delay, plays the decay effect, waits decayDuration and then the server destroys the page. Stops if docked.
private void OnDestroy()Private: releases any running decay effect.
private void OriginalDockFilter(Interactor interactor, PickupDock dock, ref bool result)Private: refuses all docks for an original page.
private void OriginalInteractionFilter(Interactor interactor, Interactable interactable, ref bool result)Private: refuses new interactions with an original page.
private void StartDecay(Interactable interactable, Interactor interactor)Private: starts Decay when a duplicate is let go.
private void StopDecay(Interactable interactable, Interactor interactor)Private: stops decay and its effect when a duplicate is picked up.
private void StopDecayDock(Interactor interactor, Pickup pickup, PickupDock dock)Private: stops decay and its effect when a duplicate is docked.

Used in​

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