mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Scale planet destruction volume at the end
This commit is contained in:
parent
cc4194ccad
commit
fb5b7b87c8
@ -39,7 +39,9 @@ namespace NewHorizons.Components.SizeControllers
|
||||
private float _collapseTimer;
|
||||
|
||||
public float collapseTime = 10f; // seconds
|
||||
public float supernovaTime = 45f; // seconds
|
||||
public float supernovaScaleStart = 45f; // seconds
|
||||
public float supernovaScaleEnd = 50f; // seconds
|
||||
public float supernovaTime = 50f; // seconds
|
||||
public float lifespan = 22f; // minutes
|
||||
public float supernovaSize = 50000f;
|
||||
|
||||
@ -228,6 +230,12 @@ namespace NewHorizons.Components.SizeControllers
|
||||
if (_planetDestructionVolume != null) _planetDestructionVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius() * 0.9f;
|
||||
if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one * supernova.GetSupernovaRadius();
|
||||
|
||||
var t = Mathf.Clamp01((Time.time - (_supernovaStartTime + supernovaScaleStart)) / (supernovaScaleEnd - supernovaScaleStart));
|
||||
if (t > 0)
|
||||
{
|
||||
_planetDestructionVolume.GetComponent<SphereCollider>().radius = Mathf.Lerp(0.8f, 1, t);
|
||||
}
|
||||
|
||||
if (Time.time > _supernovaStartTime + supernovaTime)
|
||||
{
|
||||
DisableStar();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class TimeLoopController : MonoBehaviour
|
||||
@ -14,8 +14,7 @@ namespace NewHorizons.Components
|
||||
public void Update()
|
||||
{
|
||||
// Stock gives like 33 seconds after the sun collapses
|
||||
// Gonna assume it takes like 7 seconds to collapse after the supernova trigger
|
||||
if (_supernovaHappened && Time.time > _supernovaTime + 40f)
|
||||
if (_supernovaHappened && Time.time > _supernovaTime + 50f)
|
||||
{
|
||||
Locator.GetDeathManager().KillPlayer(DeathType.TimeLoop);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user