mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add option for there to be no shock layer for atmospheres. (#330)
This commit is contained in:
commit
fc4626abcf
@ -23,28 +23,31 @@ 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;
|
|
||||||
|
|
||||||
var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>();
|
|
||||||
shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric;
|
|
||||||
shockLayerRuleset._radialCenter = airGO.transform;
|
|
||||||
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
|
|
||||||
shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed;
|
|
||||||
|
|
||||||
if (config.Atmosphere.clouds != null)
|
|
||||||
{
|
{
|
||||||
shockLayerRuleset._innerRadius = config.Atmosphere.clouds.innerCloudRadius;
|
// Try to parent it to the same as other rulesets to match vanilla but if its null put it on the root object
|
||||||
shockLayerRuleset._outerRadius = config.Atmosphere.clouds.outerCloudRadius;
|
var ruleSetGO = planetGO.GetComponentInChildren<PlanetoidRuleset>()?.gameObject;
|
||||||
}
|
if (ruleSetGO == null) ruleSetGO = planetGO;
|
||||||
else
|
|
||||||
{
|
|
||||||
var bottom = config.Base.surfaceSize;
|
|
||||||
var top = config.Atmosphere.size;
|
|
||||||
|
|
||||||
shockLayerRuleset._innerRadius = (bottom + top) / 2f;
|
var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>();
|
||||||
shockLayerRuleset._outerRadius = top;
|
shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric;
|
||||||
|
shockLayerRuleset._radialCenter = airGO.transform;
|
||||||
|
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
|
||||||
|
shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed;
|
||||||
|
|
||||||
|
if (config.Atmosphere.clouds != null)
|
||||||
|
{
|
||||||
|
shockLayerRuleset._innerRadius = config.Atmosphere.clouds.innerCloudRadius;
|
||||||
|
shockLayerRuleset._outerRadius = config.Atmosphere.clouds.outerCloudRadius;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var bottom = config.Base.surfaceSize;
|
||||||
|
var top = config.Atmosphere.size;
|
||||||
|
|
||||||
|
shockLayerRuleset._innerRadius = (bottom + top) / 2f;
|
||||||
|
shockLayerRuleset._outerRadius = top;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.Atmosphere.hasOxygen)
|
if (config.Atmosphere.hasOxygen)
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -313,6 +313,11 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether we use an atmospheric shader on the planet. Doesn't affect clouds, fog, rain, snow, oxygen, etc. Purely\nvisual."
|
"description": "Whether we use an atmospheric shader on the planet. Doesn't affect clouds, fog, rain, snow, oxygen, etc. Purely\nvisual."
|
||||||
},
|
},
|
||||||
|
"hasShockLayer": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this atmosphere will have flames appear when your ship goes a certain speed.",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"minShockSpeed": {
|
"minShockSpeed": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "Minimum speed that your ship can go in the atmosphere where flames will appear.",
|
"description": "Minimum speed that your ship can go in the atmosphere where flames will appear.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user