Skip to main content

SkillOrbMovement

A class in Root.Township, the global namespace.

Moves a skill orb from its origin up to a midpoint, then out to its target slot, when a skill shrine spawns it. Reached through SkillOrb.Movement.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private float currentVelocityUnused field.
private AnimationCurve expansionSpeedOverTimeSpeed by time for the leg from midpoint to target.
private Coroutine movementCoroutineRunning movement coroutine, or null.
private AnimationCurve risingSpeedOverDistanceSpeed by fraction of distance covered for the leg from origin to midpoint.

Properties​

MemberWhat it is
bool HasArrived { get; private set; }True once the orb has reached Target.
Vector3 MidPoint { get; private set; }Point the orb rises to before heading to its target.
Vector3 Origin { get; private set; }Where the orb starts.
Vector3 Target { get; private set; }Where the orb ends up.

Methods​

MemberWhat it is
void Serialize(Stream stream, Chunk chunk)Syncs origin, midpoint and target; on reading (except in local test) starts the movement.
void SetMovement(Vector3 origin, Vector3 midPoint, Vector3 target)Sets the path and starts moving. On a headless server the orb jumps straight to the target.
1 private and internal method
MemberWhat it is
private IEnumerator MoveTowards() (iterator)Coroutine that moves the orb through the midpoint to the target using the two speed curves.

Used in​

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