Skip to main content

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.

Constructors​

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

Fields​

14 private and internal fields
MemberWhat it is
private Color activeColorCurrent particle colour.
private ParticleSystem androidParticlesSeparate particle system, probably for the Android build.
private Color buyingColorParticle colour when buying.
private PlayerCharacter characterPlayer character whose IK update drives RenderUpdate.
private int directionSide sign, flipped for the right hand.
private Transform elbowThe arm's elbow bone.
private Transform handThe arm's wrist bone.
private bool isBuyingWhether the stream is for buying (reversed flow).
private ParticleSystem particlesParticle system moved along the spline.
private ParticleSystem.Particle[] ParticlesBuffer of particles read and written each render update.
private Color sellingColorParticle colour when selling.
private float[] speedParametersTangent lengths at each spline stage, indexed by SplineParamaters.
private BezierSpline splineThe Bezier spline the particles follow.
private Vector3 targetPositionWorld position of the orb.

Methods​

MemberWhat 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
MemberWhat 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.