Partiially working Timeslot-change and Heat Reciever on Targets
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class RecieveHeat : MonoBehaviour
|
||||
{
|
||||
private float heatLevel;
|
||||
private Material myMat;
|
||||
private void Start()
|
||||
{
|
||||
myMat = GetComponent<Renderer>().material;
|
||||
}
|
||||
|
||||
public void SetHeat(float heat)
|
||||
{
|
||||
if (heat > 255) return;
|
||||
heatLevel = heat;
|
||||
myMat.color = new Color(heatLevel,0,0);
|
||||
}
|
||||
|
||||
public void AddHeat(float heat)
|
||||
{
|
||||
heatLevel += heat;
|
||||
myMat.color = new Color(heatLevel, 0, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user