From 7dfda24e36b99c8e28f03bbaf6d239616dcc1025 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Thu, 18 Aug 2022 19:35:36 -0400 Subject: [PATCH] Scale --- NewHorizons/Builder/Body/SupernovaEffectBuilder.cs | 8 +++++--- NewHorizons/External/Modules/ShockEffectModule.cs | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs b/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs index a6c0afed..8e4ac09b 100644 --- a/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs +++ b/NewHorizons/Builder/Body/SupernovaEffectBuilder.cs @@ -130,13 +130,15 @@ namespace NewHorizons.Builder.Body supernovaEffectController._shockLayerTrailFlare = 100; supernovaEffectController._shockLayerTrailLength = biggestSize < 600 ? 300 : 600; + var scale = config.ShockEffect != null ? config.ShockEffect.scale : 1.1f; + shockLayer.transform.position = planetGO.transform.position; - shockLayer.transform.localScale = Vector3.one * biggestSize * 1.1f; + shockLayer.transform.localScale = Vector3.one * biggestSize * scale; if (!noMeshChange && procGen != null) { shockLayer.GetComponent().sharedMesh = procGen.GetComponent().sharedMesh; - shockLayer.transform.localScale = Vector3.one * 1.1f; + shockLayer.transform.localScale = Vector3.one * scale; shockLayer.transform.rotation = Quaternion.Euler(90, 0, 0); } @@ -148,7 +150,7 @@ namespace NewHorizons.Builder.Body if (mesh != null) { shockLayer.GetComponent().sharedMesh = mesh; - shockLayer.transform.localScale = Vector3.one * 1.1f; + shockLayer.transform.localScale = Vector3.one * scale; shockLayer.transform.rotation = Quaternion.Euler(0, 0, 0); } } diff --git a/NewHorizons/External/Modules/ShockEffectModule.cs b/NewHorizons/External/Modules/ShockEffectModule.cs index c5b794d1..7cab94f2 100644 --- a/NewHorizons/External/Modules/ShockEffectModule.cs +++ b/NewHorizons/External/Modules/ShockEffectModule.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -13,7 +14,12 @@ namespace NewHorizons.External.Modules /// /// Does this planet have a shock effect when the nearest star goes supernova? Automatically disabled for stars, focal points, and stellar remnants. /// - public bool hasSupernovaShockEffect = true; + [DefaultValue(true)] public bool hasSupernovaShockEffect = true; + + /// + /// Scale of the shock effect mesh + /// + [DefaultValue(1.1f)] public float scale = 1.1f; /// /// Asset Bundle that contains the shock effect mesh