Skip to main content

ReviveOrbMovementModifier

A class in Root.Township, Township.Downed.

Makes a revive orb's anchor drift between random points around its origin, with ease in and out.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private readonly AnimationCurve curveEase in and out curve for each move.
private Vector3 movementRangePer-axis size of the random offset around the origin.
private float moveSpeedDrift speed in units per second.
private Vector3 originalPositionLocal position the drift is centred on.
private Vector3 startingPositionWhere the current move started.
private Vector3 targetPositionWhere the current move ends.
private float timerTime left in the current move.
private float timeToMoveDuration of the current move.

Methods​

MemberWhat it is
void Initialize(Vector3 movementRange, float moveSpeed)Sets range and speed, takes the current local position as origin and starts drifting.
void SetOriginPosition(Vector3 newPosition)Restarts drifting around a new origin.
1 private and internal method
MemberWhat it is
private IEnumerator LerpToPosition() (iterator)Coroutine that moves to a random point in range at moveSpeed, then picks another.

Used in​

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