SplineParticlesPooled
A class in Root.Township, the global namespace.
Client: a pooled curved line with particles running along it between two transforms, such as the crafting line between parts.
- Listed in Global namespace: S
- Inherits or implements
PooledObject - Derived types
ChiselSplineParticlesPooled
Constructors
| Member | What it is |
|---|---|
SplineParticlesPooled() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
protected Transform origin | The start transform. |
protected Transform target | The end transform. |
5 private and internal fields
| Member | What it is |
|---|---|
private PlayerCharacter character | Player character whose IK pre-render callback drives updates, if Set got one. |
private Color color | Backing field for Color. |
private bool hasParticlesOnAndroid | Inspector flag. Not read anywhere in this class. |
private int intervals | Number of line points along the spline, from CraftingLineIterations (at least 2). |
private static Logger logger | NLog logger for this class. |
Properties
4 private and internal properties
| Member | What it is |
|---|---|
private ParticleSystem.Particle[] Particles { get; set; } | Buffer for reading and rewriting the particle system's particles, regrown if maxParticles increases. |
private float Speed { get; set; } | Control point length for the spline ends, from PickupTypeSettings.CraftingLineVelocity. |
private BezierSpline Spline { get; set; } | The child Bezier spline that the line and particles follow. |
private ParticleSystem System { get; set; } | The child particle system whose particles are placed along the spline. |
Methods
| Member | What it is |
|---|---|
void RenderUpdate() | Rebuilds the curve, line points and particle positions. |
void Set(Transform origin, Transform target, PlayerController player, Color color) | Connects the line between two transforms with a colour. For player characters it updates before IK rendering, otherwise every frame. |
protected virtual void Awake() | Finds the spline, particle system and line renderer, and reads line speed and segment count from pickup type settings. |
protected virtual float Multiplier() | How far the curve's control points stick out: 30% alignment, 70% distance. |
2 private and internal methods
| Member | What it is |
|---|---|
private void ResetUnpooled(PooledObject pooledObject) | Runs on release: unhooks RenderUpdate from the character's IK pre-render callback. |
private void Update() | Calls RenderUpdate each frame when there is no player character to hook into. |
Used in
Members of other types that take, return or hold a SplineParticlesPooled: