23 lines
490 B
C#
23 lines
490 B
C#
|
using Godot;
|
||
|
using System;
|
||
|
|
||
|
public class HeatOverlay : Overlay
|
||
|
{
|
||
|
[Export]
|
||
|
private Color _coldColor;
|
||
|
|
||
|
[Export]
|
||
|
private Color _hotColor;
|
||
|
|
||
|
public override void Initialise(Tile tile, ShaderMaterial material)
|
||
|
{
|
||
|
material.SetShaderParam("lowColor", _coldColor);
|
||
|
material.SetShaderParam("highColor", _hotColor);
|
||
|
}
|
||
|
|
||
|
public override void Process(Tile tile, ShaderMaterial material)
|
||
|
{
|
||
|
material.SetShaderParam("t", tile.temperature);
|
||
|
}
|
||
|
}
|