Skip to main content

CaveTeleporterReplacerAnimator.ObjectHandler

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Private helper that puts one object's renderers on a copy of the animating material and drives its shader values.

Constructors​

MemberWhat it is
ObjectHandler(RendererGroup rendererGroup, Material baseMaterial, AnimationCurve curve)Creates a CaveTeleporterReplacerAnimator.ObjectHandler from rendererGroup, baseMaterial and curve.

Fields​

5 private and internal fields
MemberWhat it is
private static readonly int _MaxHeightShader property id for _MaxHeight.
private static readonly int _ProgressShader property id for _Progress.
private static readonly int _WorldZeroHeightShader property id for _WorldZeroHeight.
private AnimationCurve curveCurve that maps animation progress to the shader progress.
private Dictionary<Renderer, Material> originalMaterialsEach renderer's shared material from before the animation.

Properties​

MemberWhat it is
Material AnimatingMaterial { get; private set; }Copy of the base material that all the object's renderers use during the animation.
Bounds Bounds { get; private set; }Combined renderer bounds, used to work out the height range of the effect.

Methods​

MemberWhat it is
void Dispose(bool returnToOriginal)Either restores the original materials or disables the renderers, then cleans up the material a second later.
void SetHeight(float zeroHeight, float height)Sets the shader's zero height and inverse height range.
void SetProgress(float progress)Evaluates the curve at the given progress and sets the shader's _Progress.