Supernova speed

This commit is contained in:
TerrificTrifid 2022-08-21 21:50:40 -05:00
parent 862bc1c797
commit 22bf326d69
2 changed files with 10 additions and 2 deletions

View File

@ -313,8 +313,9 @@ namespace NewHorizons.Builder.Body
var stellarDeath = supernovaGO.AddComponent<StellarDeathController>();
stellarDeath.enabled = false;
stellarDeath._surface = starGO.GetComponentInChildren<TessellatedSphereRenderer>();
stellarDeath._supernovaScale = new AnimationCurve(new Keyframe(0, 200, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(45, starModule.supernovaSize, 1758.508f, 1758.508f, 1f / 3f, 1f / 3f));
stellarDeath._supernovaAlpha = new AnimationCurve(new Keyframe(5, 1, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(15, 1.0002f, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(50, 0, -0.0578f, 1 / 3f, -0.0578f, 1 / 3f));
var duration = starModule.supernovaSize / starModule.supernovaSpeed;
stellarDeath._supernovaScale = new AnimationCurve(new Keyframe(0, 200, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration, starModule.supernovaSize, 1758.508f, 1758.508f, 1f / 3f, 1f / 3f));
stellarDeath._supernovaAlpha = new AnimationCurve(new Keyframe(duration / 9f, 1, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration / 3f, 1.0002f, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration, 0, -0.0578f, 1 / 3f, -0.0578f, 1 / 3f));
stellarDeath._explosionParticles = supernova._explosionParticles;
stellarDeath._shockwave = supernova._shockwave;
stellarDeath._shockwaveLength = supernova._shockwaveLength;

View File

@ -63,6 +63,13 @@ namespace NewHorizons.External.Modules.VariableSize
[Range(0f, double.MaxValue)]
public float supernovaSize = 50000f;
/// <summary>
/// Speed of the supernova wall in meters per second.
/// </summary>
[DefaultValue(1111f)]
[Range(1f, double.MaxValue)]
public float supernovaSpeed = 1111f;
/// <summary>
/// The tint of the supernova this star creates when it dies.
/// </summary>