mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add supernovaSize
This commit is contained in:
parent
0f687d6481
commit
469c8d7444
@ -187,6 +187,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
var controller = starGO.AddComponent<StarEvolutionController>();
|
var controller = starGO.AddComponent<StarEvolutionController>();
|
||||||
if (starModule.curve != null) controller.SetScaleCurve(starModule.curve);
|
if (starModule.curve != null) controller.SetScaleCurve(starModule.curve);
|
||||||
controller.size = starModule.size;
|
controller.size = starModule.size;
|
||||||
|
controller.supernovaSize = starModule.supernovaSize;
|
||||||
controller.supernova = supernova;
|
controller.supernova = supernova;
|
||||||
controller.StartColour = starModule.tint;
|
controller.StartColour = starModule.tint;
|
||||||
controller.EndColour = starModule.endTint;
|
controller.EndColour = starModule.endTint;
|
||||||
@ -286,6 +287,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
var supernova = supernovaGO.GetComponent<SupernovaEffectController>();
|
var supernova = supernovaGO.GetComponent<SupernovaEffectController>();
|
||||||
supernova._surface = starGO.GetComponentInChildren<TessellatedSphereRenderer>();
|
supernova._surface = starGO.GetComponentInChildren<TessellatedSphereRenderer>();
|
||||||
|
supernova._supernovaScale = AnimationCurve.Linear(5, 0, 15, starModule.supernovaSize);
|
||||||
supernova._supernovaVolume = null;
|
supernova._supernovaVolume = null;
|
||||||
|
|
||||||
if (starModule.supernovaTint != null)
|
if (starModule.supernovaTint != null)
|
||||||
|
|||||||
@ -40,6 +40,7 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
public float collapseTime = 10f; // seconds
|
public float collapseTime = 10f; // seconds
|
||||||
public float lifespan = 22f; // minutes
|
public float lifespan = 22f; // minutes
|
||||||
|
public float supernovaSize = 50000f;
|
||||||
|
|
||||||
private bool _isSupernova;
|
private bool _isSupernova;
|
||||||
private float _supernovaStartTime;
|
private float _supernovaStartTime;
|
||||||
@ -255,7 +256,7 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
if (start && _planetDestructionVolume != null)
|
if (start && _planetDestructionVolume != null)
|
||||||
{
|
{
|
||||||
foreach (var collider in Physics.OverlapSphere(_planetDestructionVolume.transform.position, _planetDestructionVolume.GetComponent<SphereCollider>().radius * 50000f * 0.9f))
|
foreach (var collider in Physics.OverlapSphere(_planetDestructionVolume.transform.position, _planetDestructionVolume.GetComponent<SphereCollider>().radius * supernovaSize * 0.9f))
|
||||||
{
|
{
|
||||||
if (collider.attachedRigidbody != null)
|
if (collider.attachedRigidbody != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,6 +52,13 @@ namespace NewHorizons.External.Modules.VariableSize
|
|||||||
[DefaultValue(1f)] [Range(0f, double.MaxValue)]
|
[DefaultValue(1f)] [Range(0f, double.MaxValue)]
|
||||||
public float solarLuminosity = 1f;
|
public float solarLuminosity = 1f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Radius of the supernova.
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(50000f)]
|
||||||
|
[Range(0f, double.MaxValue)]
|
||||||
|
public float supernovaSize = 50000f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tint of the supernova this star creates when it dies.
|
/// The tint of the supernova this star creates when it dies.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user