diff --git a/Assets/Script/Gameplay/GameManager.cs b/Assets/Script/Gameplay/GameManager.cs index 656d981aa..589a76d9a 100644 --- a/Assets/Script/Gameplay/GameManager.cs +++ b/Assets/Script/Gameplay/GameManager.cs @@ -162,8 +162,8 @@ private void OnDestroy() Navigator.Instance.NavigationEvent -= OnNavigationEvent; } GlobalVariables.AudioManager.SongEnd -= OnAudioEnd; - _songRunner.Dispose(); - BeatEventHandler.Unsubscribe(StarPowerClap); + _songRunner?.Dispose(); + BeatEventHandler?.Unsubscribe(StarPowerClap); BackgroundManager.Dispose(); // Reset the time scale back, as it would be 0 at this point (because of pausing) diff --git a/Assets/Script/Gameplay/GameplayBehaviour.cs b/Assets/Script/Gameplay/GameplayBehaviour.cs index 653494296..9b109ab6d 100644 --- a/Assets/Script/Gameplay/GameplayBehaviour.cs +++ b/Assets/Script/Gameplay/GameplayBehaviour.cs @@ -45,9 +45,10 @@ protected void Awake() // Protected to warn when hidden by an inheriting class protected void OnDestroy() { - GameplayDestroy(); + if (GameManager == null) + return; - if (GameManager == null) return; + GameplayDestroy(); GameManager.ChartLoaded -= _OnChartLoaded; GameManager.SongLoaded -= _OnSongLoaded; diff --git a/Assets/Script/Integration/StageKit/StageKitGameplay.cs b/Assets/Script/Integration/StageKit/StageKitGameplay.cs index ff582b082..8d10fd58e 100644 --- a/Assets/Script/Integration/StageKit/StageKitGameplay.cs +++ b/Assets/Script/Integration/StageKit/StageKitGameplay.cs @@ -307,6 +307,9 @@ private void HandleVenue(LightingType lightingEvent) protected override void GameplayDestroy() { + if (_controller == null) + return; + _controller.AllLedsOff(); KillCue(); _controller.StageKits.ForEach(kit => kit.ResetHaptics());