Update ModuleRestockHeatEffects to fix instantiation issues

Untested (will test when I get home)
This commit is contained in:
Andrew Cassidy 2019-12-03 12:41:33 -08:00
parent 38ecd498b0
commit 6cd78839ae
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1
2 changed files with 22 additions and 19 deletions

View File

@ -13,7 +13,7 @@ namespace Restock
[KSPField] public string shaderProperty = "_EmissiveColor"; [KSPField] public string shaderProperty = "_EmissiveColor";
// animation curve for the red channel // animation curve for the red channel
[KSPField] public FloatCurve redCurve= new FloatCurve(); [KSPField] public FloatCurve redCurve = new FloatCurve();
// animation curve for the green channel // animation curve for the green channel
[KSPField] public FloatCurve greenCurve = new FloatCurve(); [KSPField] public FloatCurve greenCurve = new FloatCurve();
@ -42,7 +42,7 @@ namespace Restock
// should the module disable the stock blackbody glow effect on the included renderers? // should the module disable the stock blackbody glow effect on the included renderers?
[KSPField] public bool disableBlackbody = false; [KSPField] public bool disableBlackbody = false;
[KSPField] public List<Renderer> renderers = new List<Renderer>(); public List<Renderer> renderers = new List<Renderer>();
private readonly string _shaderBlackbody = "_TemperatureColor"; private readonly string _shaderBlackbody = "_TemperatureColor";
@ -54,13 +54,16 @@ namespace Restock
private double _lerpRange; private double _lerpRange;
private Color _emissiveColor = new Color(); private Color _emissiveColor;
private MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock(); private MaterialPropertyBlock _propertyBlock;
public void Start() public void Start()
{ {
if (base.vessel == null) return; if (base.vessel == null) return;
_emissiveColor = new Color();
_propertyBlock = new MaterialPropertyBlock();
if (enableHeatEmissive) if (enableHeatEmissive)
{ {
if (useCoreTemp) if (useCoreTemp)