Skip to main content

VfxData

A class in Root.Township, Features.Visual_Effects.VFXData.

Settings asset for a two-part particle effect: particles that spawn, fly to a destination (usually the player) and trigger an arrival effect. Used for effects like gaining a skill orb. Looked up by hash.

Constructors​

MemberWhat it is
VfxData()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private float particleAccelerationBacking field for ParticleAcceleration, extra speed per second (0.1 by default).
private ParticleDestination particleDestinationBacking field for ParticleDestination, where the particles fly to. Custom is for internal use.
private PooledObjectDefinition particlesOnArrivalBacking field for ParticlesOnArrival, the pooled effect spawned when the particles reach the player.
private float particleSpeedBacking field for ParticleSpeed, in metres per second (1 by default).
private PooledObjectDefinition particlesToTransformBacking field for ParticlesToTransform, the pooled effect spawned when the player unlocks something.
private bool shouldPlayVFXBacking field for ShouldPlayVFX. Turn off to disable the effect without changing references.
private float timeToStartMovingBacking field for TimeToStartMoving, the delay before the script moves the particles (1.1 seconds by default).

Properties​

MemberWhat it is
float ParticleAcceleration { get; }Extra speed the travelling particles gain, in metres per second.
ParticleDestination ParticleDestination { get; }Where the particles fly to.
PooledObjectDefinition ParticlesOnArrival { get; }Pooled effect spawned when the particles arrive.
float ParticleSpeed { get; }Starting speed of the travelling particles, in metres per second.
PooledObjectDefinition ParticlesToTransform { get; }Pooled effect whose particles fly to the destination.
bool ShouldPlayVFX { get; }Switch to turn the effect off without removing references to it.
float TimeToStartMoving { get; }Delay before the particles start flying, in seconds.

Used in​

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