From 1297d08805013b770c3c74455116deba389d45b4 Mon Sep 17 00:00:00 2001 From: "r.nikolin" Date: Tue, 31 Oct 2023 11:52:24 +0300 Subject: [PATCH] Fix bug with DisableAfterFinish null reference --- Assets/DisableAfterFinish.cs | 6 ++++++ Assets/_Monuments/Prefabs/Big/Monument_Origin.prefab | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/DisableAfterFinish.cs b/Assets/DisableAfterFinish.cs index 23ea0a9a..d3bcc486 100644 --- a/Assets/DisableAfterFinish.cs +++ b/Assets/DisableAfterFinish.cs @@ -17,11 +17,17 @@ public class DisableAfterFinish : MonoBehaviour private void OnEnable() { + if (disableController == null) + return; + disableController.DoDisable += Disable; } private void OnDisable() { + if (disableController == null) + return; + disableController.DoDisable -= Disable; } diff --git a/Assets/_Monuments/Prefabs/Big/Monument_Origin.prefab b/Assets/_Monuments/Prefabs/Big/Monument_Origin.prefab index bc7c3ff7..25caa52e 100644 --- a/Assets/_Monuments/Prefabs/Big/Monument_Origin.prefab +++ b/Assets/_Monuments/Prefabs/Big/Monument_Origin.prefab @@ -267,7 +267,7 @@ MonoBehaviour: Sound: Clip: {fileID: 0} Volume: 1 - Priority: 128 + Priority: 256 Pitch: 1 Zone: 0 PlayOnAwake: 0