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.
- Listed in Global namespace: P
- Inherits or implements
PooledObject
Constructors
| Member | What it is |
|---|---|
PageAutoAddEffect() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private readonly int _Progress | Shader property id for the dissolve progress. |
private Material animationMaterial | The page's dissolve material copy. |
private GhostBook book | The ghost book receiving the page. |
private float bookSpawnDistance | How far in front of the player the book appears. |
private Vector3 bookTargetPosition | Where a new ghost book is placed. |
private Quaternion bookTargetRotation | Rotation for a new ghost book, facing the player. |
private float delayToCallBook | Seconds into the dissolve before the book is called. |
private float dissolveDuration | Length of the dissolve in seconds. |
private Coroutine fadeToGhostCoroutine | The running FadeToGhost coroutine. |
private PooledObjectDefinition ghostBookDefinition | Pool definition for the ghost book. |
Properties
| Member | What it is |
|---|---|
FauxRigidbody RigidBody { get; private set; } | Fake rigidbody that moves the page. |
Methods
| Member | What 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
| Member | What 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: