A class in Root.Township, the global namespace.
Script animation that loops a transform's scale along a curve, added per axis on top of a base scale.
Constructors
| Member | What it is |
|---|
AnimateScaleOverTime() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private float animationSpeed | How fast the curve is played. 1 means one curve unit per second. |
private Vector3 baseScale | Scale the curve offsets from. |
private Vector3 componentWiseImpact | Per-axis multiplier for the curve value. |
private float currentTime | Looped curve time, kept between 0 and 1. |
private AnimationCurve scaleAnimation | Curve of the scale offset over one loop. |
Methods
| Member | What it is |
|---|
override float GetLengthOfAnimationInSeconds() | Time of the curve's last key divided by animationSpeed. |
override void ResetState() | Restores the base scale. |
protected override void UpdateAnimation() | Advances the looped time and sets the scale to base plus impact times the curve value. |
1 private and internal method
| Member | What it is |
|---|
private bool SetupBaseScale() | Editor button handler: copies the transform's current scale into baseScale. |
Used in
Members of other types that take, return or hold a AnimateScaleOverTime: