SkillOrbInteractionSpline
A class in Root.Township, the global namespace.
Pooled particle stream that flows along a spline from a player's elbow through the wrist to a skill orb, coloured for buying or selling. Client visuals.
- Listed in Global namespace: S
- Inherits or implements
PooledObject - Nested types
SplineParamaters
Constructors
| Member | What it is |
|---|---|
SkillOrbInteractionSpline() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
14 private and internal fields
| Member | What it is |
|---|---|
private Color activeColor | Current particle colour. |
private ParticleSystem androidParticles | Separate particle system, probably for the Android build. |
private Color buyingColor | Particle colour when buying. |
private PlayerCharacter character | Player character whose IK update drives RenderUpdate. |
private int direction | Side sign, flipped for the right hand. |
private Transform elbow | The arm's elbow bone. |
private Transform hand | The arm's wrist bone. |
private bool isBuying | Whether the stream is for buying (reversed flow). |
private ParticleSystem particles | Particle system moved along the spline. |
private ParticleSystem.Particle[] Particles | Buffer of particles read and written each render update. |
private Color sellingColor | Particle colour when selling. |
private float[] speedParameters | Tangent lengths at each spline stage, indexed by SplineParamaters. |
private BezierSpline spline | The Bezier spline the particles follow. |
private Vector3 targetPosition | World position of the orb. |
Methods
| Member | What it is |
|---|---|
void RenderUpdate() | Rebuilds the spline from the arm and orb positions and moves each particle along it by lifetime. |
void Set(Interactor interactor, Interactable orb, bool isBuying) | Attaches the stream to the interacting hand's arm and the orb and picks the colour. |
protected virtual void Awake() | Sizes the particle buffer and hooks Requested to clean up. |
2 private and internal methods
| Member | What it is |
|---|---|
private int GetIndex(int index, int max) | Reverses a control point index when buying, so the stream flows the other way. |
private void ResetUnpooled(PooledObject pooledObject) | Unhooks from the character's IK pre-render callback. |