diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index adc97d7d..a0892f17 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -13,6 +13,8 @@ namespace NewHorizons.Builder.Body { public static class BrambleDimensionBuilder { + public static readonly float BASE_DIMENSION_RADIUS = 1705f; + // put node here // "position": {"x": 65.2428, "y": -137.305, "z": 198.1078}, "normal": {"x": 0.303696, "y": -0.5609235, "z": 0.7701519} @@ -53,7 +55,9 @@ namespace NewHorizons.Builder.Body ao.transform.position = new Vector3(6904.48f, 17048.44f, 5574.479f) + new Vector3(0, 3000, 0)*DIMENSION_COUNTER; DIMENSION_COUNTER++; - // TODO: radius (need to determine what the base radius is first) + // radius + //if (body.Config.Bramble.dimension.radius != null) + ao.transform.localScale = Vector3.one * (body.Config.Bramble.dimension.radius/BASE_DIMENSION_RADIUS); // fix children's names and remove base game props (mostly just bramble nodes that are children to Interactibles) and set up the OuterWarp child var dimensionSector = SearchUtilities.FindChild(dimension, "Sector_HubDimension"); diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 19f93065..5c0b6422 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -154,6 +154,10 @@ namespace NewHorizons.Builder.Props var destinationAO = dimensionAO ?? AstroObjectLocator.GetAstroObject(destinationName); // find child "Sector/OuterWarp" if (destinationAO == null) return false; + // + // TODO: support adding destinationAO's signals to these nodes + // + var destination = GetOuterFogWarpVolumeFromAstroObject(destinationAO.gameObject); if (destination == null) return false; @@ -191,15 +195,20 @@ namespace NewHorizons.Builder.Props GameObject.Destroy(SearchUtilities.FindChild(brambleNode, "Signal_Harmonica")); // - // TODO: change the colors + // set scale + // + + brambleNode.transform.localScale = Vector3.one * config.scale; + + // + // change the colors // var effects = SearchUtilities.FindChild(brambleNode, "Effects"); var fogRenderer = SearchUtilities.FindChild(effects, "InnerWarpFogSphere").GetComponent(); var lightShafts = SearchUtilities.FindChild(effects, "DB_BrambleLightShafts"); - - if (config.fogTint != null) fogRenderer.SetColor(config.fogTint.ToColor()); + if (config.fogTint != null) fogRenderer.SetColor(config.fogTint.ToColor()); // TODO: this doesn't seem to work, but it does work in inspector if (config.lightTint != null) { var lightShaft1 = SearchUtilities.FindChild(lightShafts, "BrambleLightShaft1"); @@ -226,27 +235,6 @@ namespace NewHorizons.Builder.Props warpController.Awake(); // I can't spawn this game object disabled, but Awake needs to run after _sector is set. That means I need to call Awake myself - //var exitPointsParent = SearchUtilities.FindChild(brambleNode, "FogWarpExitPoints"); // "ExitPoint", "ExitPoint (1)" ... "ExitPoint (5)" - //var exitPointsNames = new string[] - //{ - // "ExitPoint", - // "ExitPoint (1)", - // "ExitPoint (2)", - // "ExitPoint (3)", - // "ExitPoint (4)", - // "ExitPoint (5)", - //}; - //for (int i = 0; i < 6; i++) - //{ - // var exitPoint = SearchUtilities.FindChild(exitPointsParent, exitPointsNames[i]); - // var sphericalFogWarpExit = exitPoint.GetComponent(); - // // I don't think anything actually needs to be done here - //} - - // - // TODO: support adding signals to these nodes - // - // // Cleanup for dimension exits // diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index 50015dd5..0bfc04f3 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -2,6 +2,7 @@ using NewHorizons.Utility; using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -29,7 +30,7 @@ namespace NewHorizons.External.Modules /// /// Defines the inner radius of this dimension. Leave blank for the default of /// - public float radius; + [DefaultValue(1705f)] public float radius = 1705f; /// /// The color of the fog inside this dimension. Leave blank for the default yellowish color @@ -59,7 +60,7 @@ namespace NewHorizons.External.Modules /// /// The physical scale of the node /// - public float scale; + [DefaultValue(1f)] public float scale = 1f; /// /// The name of the planet that hosts the dimension this node links to @@ -74,7 +75,7 @@ namespace NewHorizons.External.Modules /// /// Set this to true to make this node a seed instead of a node the player can enter /// - public bool isSeed; + [DefaultValue(false)] public bool isSeed = false; /// /// The color of the fog inside the node. Leave blank for the default yellowish color