This commit is contained in:
Noah Pilarski 2022-08-18 19:35:36 -04:00
parent ab45daaf5c
commit 7dfda24e36
2 changed files with 12 additions and 4 deletions

View File

@ -130,13 +130,15 @@ namespace NewHorizons.Builder.Body
supernovaEffectController._shockLayerTrailFlare = 100; supernovaEffectController._shockLayerTrailFlare = 100;
supernovaEffectController._shockLayerTrailLength = biggestSize < 600 ? 300 : 600; supernovaEffectController._shockLayerTrailLength = biggestSize < 600 ? 300 : 600;
var scale = config.ShockEffect != null ? config.ShockEffect.scale : 1.1f;
shockLayer.transform.position = planetGO.transform.position; 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) if (!noMeshChange && procGen != null)
{ {
shockLayer.GetComponent<MeshFilter>().sharedMesh = procGen.GetComponent<MeshFilter>().sharedMesh; shockLayer.GetComponent<MeshFilter>().sharedMesh = procGen.GetComponent<MeshFilter>().sharedMesh;
shockLayer.transform.localScale = Vector3.one * 1.1f; shockLayer.transform.localScale = Vector3.one * scale;
shockLayer.transform.rotation = Quaternion.Euler(90, 0, 0); shockLayer.transform.rotation = Quaternion.Euler(90, 0, 0);
} }
@ -148,7 +150,7 @@ namespace NewHorizons.Builder.Body
if (mesh != null) if (mesh != null)
{ {
shockLayer.GetComponent<MeshFilter>().sharedMesh = mesh; shockLayer.GetComponent<MeshFilter>().sharedMesh = mesh;
shockLayer.transform.localScale = Vector3.one * 1.1f; shockLayer.transform.localScale = Vector3.one * scale;
shockLayer.transform.rotation = Quaternion.Euler(0, 0, 0); shockLayer.transform.rotation = Quaternion.Euler(0, 0, 0);
} }
} }

View File

@ -1,6 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -13,7 +14,12 @@ namespace NewHorizons.External.Modules
/// <summary> /// <summary>
/// Does this planet have a shock effect when the nearest star goes supernova? Automatically disabled for stars, focal points, and stellar remnants. /// Does this planet have a shock effect when the nearest star goes supernova? Automatically disabled for stars, focal points, and stellar remnants.
/// </summary> /// </summary>
public bool hasSupernovaShockEffect = true; [DefaultValue(true)] public bool hasSupernovaShockEffect = true;
/// <summary>
/// Scale of the shock effect mesh
/// </summary>
[DefaultValue(1.1f)] public float scale = 1.1f;
/// <summary> /// <summary>
/// Asset Bundle that contains the shock effect mesh /// Asset Bundle that contains the shock effect mesh