ScriptedRotation
A class in Root.Township, the global namespace.
Animates a transform's local rotation between stored key rotations when Animate is called. Client only; removed on headless servers.
- Listed in Global namespace: S
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
ScriptedRotation() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private float animationSpeed | Unused: the animation always takes one second. |
private bool btnSaveKey | Inspector button that calls SaveKey. |
private Transform cachedTransform | Cached own transform. |
private int currentKey | Index of the key it's at, or turning from. |
private Quaternion[] keys | The stored local rotations. |
private float progress | Animation progress from 0 to 1. |
private int startingKey | Key it starts at. |
private int targetKey | Index of the key it's turning toward. |
private IUnityUpdateMethod update | Registered update method while animating. |
private static UpdateModule updateModule | Shared update module for all scripted rotations. |
Methods
| Member | What it is |
|---|---|
void Animate(int targetKey) | Starts turning toward the key at the given index, unless it's already there or heading there. |