Skip to main content

FireDissolve

A class in Root.Township, Alta.Heat.

A Fire that also burns its mesh away: lighting swaps its renderers to a copy of a burning material whose _Progress follows the fire's progress. Visuals are skipped on headless servers.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private static readonly int _ProgressShader property ID for _Progress.
private Material burningMaterialMaterial copied onto the renderers when lit.
private Material materialThe per-instance copy of burningMaterial.
private AnimationCurve progressCurveMaps fire progress to the shader's dissolve value.
private MeshRenderer[] renderersBacking field for Renderers.

Properties​

MemberWhat it is
MeshRenderer[] Renderers { get; }The mesh renderers that dissolve.

Methods​

MemberWhat it is
protected override void Light()When not headless and not fully burnt, gives the renderers their own copy of burningMaterial, then lights as normal.
protected override void OnValidate()Calls the base OnValidate only.
protected override void SetProgress(float progress)Sets fire progress and, when not headless, the material's _Progress from progressCurve.
1 private and internal method
MemberWhat it is
private void IBuildRendererPostBake.PostBake()Build step: removes null entries from renderers.