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
| Member | What it is |
|---|
ReviveOrbMovementModifier() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|
private readonly AnimationCurve curve | Ease in and out curve for each move. |
private Vector3 movementRange | Per-axis size of the random offset around the origin. |
private float moveSpeed | Drift speed in units per second. |
private Vector3 originalPosition | Local position the drift is centred on. |
private Vector3 startingPosition | Where the current move started. |
private Vector3 targetPosition | Where the current move ends. |
private float timer | Time left in the current move. |
private float timeToMove | Duration of the current move. |
Methods
| Member | What 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
| Member | What 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: