Skip to main content

PageAutoAddEffect

A class in Root.Township, the global namespace.

Pooled client effect for a page being added to the player's book automatically: the page dissolves, a ghost book appears in front of the player and takes it.

Constructors​

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

Fields​

10 private and internal fields
MemberWhat it is
private readonly int _ProgressShader property id for the dissolve progress.
private Material animationMaterialThe page's dissolve material copy.
private GhostBook bookThe ghost book receiving the page.
private float bookSpawnDistanceHow far in front of the player the book appears.
private Vector3 bookTargetPositionWhere a new ghost book is placed.
private Quaternion bookTargetRotationRotation for a new ghost book, facing the player.
private float delayToCallBookSeconds into the dissolve before the book is called.
private float dissolveDurationLength of the dissolve in seconds.
private Coroutine fadeToGhostCoroutineThe running FadeToGhost coroutine.
private PooledObjectDefinition ghostBookDefinitionPool definition for the ghost book.

Properties​

MemberWhat it is
FauxRigidbody RigidBody { get; private set; }Fake rigidbody that moves the page.

Methods​

MemberWhat it is
void GetPositionInFrontOfPlayer(PlayerController player)Works out the book position and rotation in front of the player at head height.
void RegisterPlayer(Interactor interactor)Sets the book position from the interactor's player.
5 private and internal methods
MemberWhat it is
private void Awake()Makes a copy of the page material for the dissolve and sets up a fake rigidbody.
private IEnumerator FadeToGhost() (iterator)Coroutine that runs the dissolve, calls the book part way through, then starts the book's page animation.
private void GetBook()Uses a nearby ghost book or spawns one in front of the player, and registers the page with it.
private void OnRequest(PooledObject pooledObject)When taken from the pool, resets the dissolve and starts FadeToGhost.
private void Update()Steps the fake rigidbody.

Used in​

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