Skip to main content

BillboardParticle

A class in Root.Township, the global namespace.

Client component for a particle system that turns it to face the main camera while it plays, for the length of the particle system.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private float durationHow long to keep facing the camera, taken from the particle system.
private Transform targetThe local player's HeadFollow, watched for movement.

Methods​

4 private and internal methods
MemberWhat it is
private IEnumerator BillboardSystem() (iterator)Coroutine: for duration seconds, looks at the camera whenever the player's head moved. Logs every time it turns.
private void OnDisable()Stops the coroutine.
private void OnEnable()Starts the billboard coroutine.
private void OnValidate()Editor: copies the duration from the particle system on the same object, or logs an error if there is none.