From ad435e5b6035bdd4f7ad90b9b677b13a58b00810 Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Sun, 10 Jul 2022 14:36:20 -0400 Subject: [PATCH] added scaling to dimensions --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 13 +++++++++++-- NewHorizons/External/Modules/BrambleModule.cs | 11 ++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index db45fb3e..b8322989 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -81,11 +81,20 @@ namespace NewHorizons.Builder.Body PairExit(config.linksTo, outerFogWarpVolume); + // Set the scale + var scale = config.radius / BASE_DIMENSION_RADIUS; + geometry.transform.localScale = Vector3.one * scale; + outerFogWarpVolume._warpRadius *= scale; + outerFogWarpVolume._exitRadius *= scale; + + var fogGO = atmo.FindChild("FogSphere_Hub"); + var fog = fogGO.GetComponent(); + fog._fogRadius *= scale; + fog._fogDensity *= scale; + // Change fog color if (body.Config.Bramble.dimension.fogTint != null) { - var fogGO = atmo.FindChild("FogSphere_Hub"); - var fog = fogGO.GetComponent(); fog.fogTint = body.Config.Bramble.dimension.fogTint.ToColor(); } diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index 61b6d272..4e499ac0 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -28,7 +28,7 @@ namespace NewHorizons.External.Modules public class BrambleDimensionInfo { /// - /// The color of the fog inside this dimension. Leave blank for the default yellowish color + /// The color of the fog inside this dimension. Leave blank for the default yellowish color: (113, 107, 81) /// public MColor fogTint; @@ -36,6 +36,11 @@ namespace NewHorizons.External.Modules /// The name of the *node* that the player is taken to when exiting this dimension. /// public string linksTo; + + /// + /// The internal radius (in meters) of the dimension. The default is 1705. + /// + [DefaultValue(1705f)] public float radius = 1705f; } @@ -73,12 +78,12 @@ namespace NewHorizons.External.Modules [DefaultValue(false)] public bool isSeed = false; /// - /// The color of the fog inside the node. Leave blank for the default yellowish color (default: 131, 124, 105, 255) + /// The color of the fog inside the node. Leave blank for the default yellowish color: (131, 124, 105, 255) /// public MColor fogTint; /// - /// The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color + /// The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255) /// public MColor lightTint; }