Remove solarFlareTint (should just use the star colour)

This commit is contained in:
Nick 2022-05-19 19:39:17 -04:00
parent 2280ba3b83
commit eb38bfb14d
4 changed files with 19 additions and 11 deletions

View File

@ -178,9 +178,17 @@ namespace NewHorizons.Builder.Body
solarFlareEmitter.transform.localScale = Vector3.one; solarFlareEmitter.transform.localScale = Vector3.one;
solarFlareEmitter.name = "SolarFlareEmitter"; solarFlareEmitter.name = "SolarFlareEmitter";
if (starModule.SolarFlareTint != null) if (starModule.Tint != null)
{ {
solarFlareEmitter.GetComponent<SolarFlareEmitter>().tint = starModule.SolarFlareTint.ToColor(); var flareTint = starModule.Tint.ToColor();
var emitter = solarFlareEmitter.GetComponent<SolarFlareEmitter>();
emitter.tint = flareTint;
foreach (var controller in solarFlareEmitter.GetComponentsInChildren<SolarFlareController>())
{
// It multiplies color by tint but wants something very bright idk
controller._color = new Color(20, 20, 20);
controller._tint = flareTint;
}
} }
starGO.transform.position = rootObject.transform.position; starGO.transform.position = rootObject.transform.position;

View File

@ -24,6 +24,7 @@ namespace NewHorizons.Components.SizeControllers
private MeshRenderer[] _atmosphereRenderers; private MeshRenderer[] _atmosphereRenderers;
private HeatHazardVolume _heatVolume; private HeatHazardVolume _heatVolume;
private DestructionVolume _destructionVolume; private DestructionVolume _destructionVolume;
private SolarFlareEmitter _flareEmitter;
private bool _isCollapsing; private bool _isCollapsing;
private float _collapseStartSize; private float _collapseStartSize;
@ -95,6 +96,8 @@ namespace NewHorizons.Components.SizeControllers
{ {
maxScale = scaleCurve.keys.Select(x => x.value).Max() * size; maxScale = scaleCurve.keys.Select(x => x.value).Max() * size;
} }
_flareEmitter = GetComponentInChildren<SolarFlareEmitter>();
} }
public void OnDestroy() public void OnDestroy()
@ -161,6 +164,8 @@ namespace NewHorizons.Components.SizeControllers
{ {
currentColour = _startColour; currentColour = _startColour;
} }
if (_flareEmitter != null) _flareEmitter._tint = currentColour;
} }
else else
{ {

View File

@ -8,7 +8,6 @@ namespace NewHorizons.External.Modules.VariableSize
public MColor Tint { get; set; } public MColor Tint { get; set; }
public MColor EndTint { get; set; } public MColor EndTint { get; set; }
public MColor SupernovaTint { get; set; } public MColor SupernovaTint { get; set; }
public MColor SolarFlareTint { get; set; }
public MColor LightTint { get; set; } public MColor LightTint { get; set; }
public float SolarLuminosity { get; set; } = 1f; public float SolarLuminosity { get; set; } = 1f;
public bool HasAtmosphere { get; set; } = true; public bool HasAtmosphere { get; set; } = true;

View File

@ -600,10 +600,6 @@
"$ref": "#/$defs/color", "$ref": "#/$defs/color",
"description": "Colour of the star at the end of its life." "description": "Colour of the star at the end of its life."
}, },
"solarFlareTint": {
"$ref": "#/$defs/color",
"description": "Colour of the solar flares. The shader is a bit weird so the value you put won't exactly reflect what you see. Try experimenting with different colours to see what works."
},
"lightTint": { "lightTint": {
"$ref": "#/$defs/color", "$ref": "#/$defs/color",
"description": "Colour of the light given off." "description": "Colour of the light given off."