Skip to main content

ParticleEffectDistanceController

A class in Root.Township, the global namespace.

Shortens the life of world-space particles that drift too far from this object. Checks every few frames; removed on headless servers.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private int evaluatorCountNumber of evaluators.
private ParticleEffectDistanceController.ParticleSystemEvaluator[] evaluatorsOne per world-space child particle system.
private int frameCountFrame counter for the update interval.
private float maxDistanceSquaredSquared distance past which particles are cut short.
private float remainingLifetimeWhenFarBacking field for RemainingLifetimeWhenFar.
private int updateFrameCountFrames between checks (default 15).

Properties​

MemberWhat it is
float RemainingLifetimeWhenFar { get; }Remaining lifetime given to particles beyond the max distance.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Removes itself on headless builds, otherwise sets up an evaluator for each world-space child particle system.
private void LateUpdate()Every updateFrameCount frames, cuts the remaining life of far particles.
private void OnDrawGizmosSelected()Editor: draws the max distance as a sphere.

Used in​

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