Skip to main content

AnimateScaleOverTime

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​

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

Fields​

5 private and internal fields
MemberWhat it is
private float animationSpeedHow fast the curve is played. 1 means one curve unit per second.
private Vector3 baseScaleScale the curve offsets from.
private Vector3 componentWiseImpactPer-axis multiplier for the curve value.
private float currentTimeLooped curve time, kept between 0 and 1.
private AnimationCurve scaleAnimationCurve of the scale offset over one loop.

Methods​

MemberWhat 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
MemberWhat 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: