Allow there to be no shock layer for atmospheres.

This commit is contained in:
Noah Pilarski 2022-08-31 04:43:25 -04:00
parent eaa57a761d
commit 94a304ffb5
2 changed files with 16 additions and 8 deletions

View File

@ -23,15 +23,18 @@ namespace NewHorizons.Builder.Atmosphere
sfv._allowShipAutoroll = true; sfv._allowShipAutoroll = true;
sfv._disableOnStart = false; sfv._disableOnStart = false;
// Try to parent it to the same as other rulesets to match vanilla but if its null put it on the root object if (config.Atmosphere.hasShockLayer)
var ruleSetGO = planetGO.GetComponentInChildren<PlanetoidRuleset>()?.gameObject; {
if (ruleSetGO == null) ruleSetGO = planetGO; // Try to parent it to the same as other rulesets to match vanilla but if its null put it on the root object
var ruleSetGO = planetGO.GetComponentInChildren<PlanetoidRuleset>()?.gameObject;
if (ruleSetGO == null) ruleSetGO = planetGO;
var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>(); var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>();
shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric;
shockLayerRuleset._radialCenter = airGO.transform; shockLayerRuleset._radialCenter = airGO.transform;
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed; shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed; shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed;
}
if (config.Atmosphere.clouds != null) if (config.Atmosphere.clouds != null)
{ {

View File

@ -100,6 +100,11 @@ namespace NewHorizons.External.Modules
/// </summary> /// </summary>
public bool useAtmosphereShader; public bool useAtmosphereShader;
/// <summary>
/// Whether this atmosphere will have flames appear when your ship goes a certain speed.
/// </summary>
[DefaultValue(true)] public bool hasShockLayer = true;
/// <summary> /// <summary>
/// Minimum speed that your ship can go in the atmosphere where flames will appear. /// Minimum speed that your ship can go in the atmosphere where flames will appear.
/// </summary> /// </summary>