mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update StellarDeathController to match vanilla SupernovaEffectController update. (#387)
This commit is contained in:
commit
e098201581
@ -22,6 +22,7 @@ namespace NewHorizons.Components.Stars
|
||||
private float _currentSupernovaScale;
|
||||
private Material _localSupernovaMat;
|
||||
private bool _isProxy;
|
||||
private bool _renderingEnabled = true;
|
||||
private ParticleSystemRenderer[] _cachedParticleRenderers;
|
||||
|
||||
public void Awake()
|
||||
@ -34,8 +35,12 @@ namespace NewHorizons.Components.Stars
|
||||
public void Activate()
|
||||
{
|
||||
enabled = true;
|
||||
shockwave.enabled = true;
|
||||
foreach (var particle in explosionParticles) particle.Play();
|
||||
shockwave.enabled = _renderingEnabled;
|
||||
for (int i = 0; i < explosionParticles.Length; i++)
|
||||
{
|
||||
explosionParticles[i].Play();
|
||||
_cachedParticleRenderers[i].enabled = _renderingEnabled;
|
||||
}
|
||||
_time = 0.0f;
|
||||
_currentSupernovaScale = supernovaScale.Evaluate(0.0f);
|
||||
_localSupernovaMat = new Material(supernovaMaterial);
|
||||
@ -97,6 +102,7 @@ namespace NewHorizons.Components.Stars
|
||||
|
||||
public void SetRenderingEnabled(bool renderingEnabled)
|
||||
{
|
||||
_renderingEnabled = renderingEnabled;
|
||||
if (!enabled) return;
|
||||
shockwave.enabled = renderingEnabled;
|
||||
SetParticlesVisibility(renderingEnabled);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user