Skip to main content

TextureOffsetAnimator

A class in Root.Township, the global namespace.

Scrolls a material's main texture offset over time on a renderer, using its own copy of the material.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Material instanciatedMaterialThe material copy being animated.
private Material materialToAnimateSource material that gets copied.
private Vector2 offsetAnimationPerSecondTexture offset change per second.
private Renderer targetRendererRenderer given the copied material.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Copies the material and puts the copy on the target renderer.
private void LateUpdate()Moves the texture offset by offsetAnimationPerSecond times the frame time.