mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix RingOpacityController NRE
This commit is contained in:
parent
608c9bb27f
commit
59721b1f55
@ -25,10 +25,22 @@ namespace NewHorizons.Components
|
||||
CurrentOpacity = 1;
|
||||
}
|
||||
|
||||
if (_ringFluidVolume != null)
|
||||
if (_ringFluidVolume != null && _ringFluidVolume.gameObject.activeInHierarchy)
|
||||
{
|
||||
if (Mathf.Approximately(CurrentOpacity, 0) && _ringFluidVolume.IsVolumeActive()) _ringFluidVolume.SetVolumeActivation(false);
|
||||
else if (!_ringFluidVolume.IsVolumeActive()) _ringFluidVolume.SetVolumeActivation(true);
|
||||
if (Mathf.Approximately(CurrentOpacity, 0))
|
||||
{
|
||||
if (_ringFluidVolume.IsVolumeActive())
|
||||
{
|
||||
_ringFluidVolume.SetVolumeActivation(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_ringFluidVolume.IsVolumeActive())
|
||||
{
|
||||
_ringFluidVolume.SetVolumeActivation(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_meshRenderer == null) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user