From 834a4c44a348dbe6603805dbf3acea04ac2545fa Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Sun, 11 Mar 2018 14:55:20 -0400 Subject: [PATCH] Add nested Save Menu error message --- Assets/Fungus/Scripts/Components/SaveMenu.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Components/SaveMenu.cs b/Assets/Fungus/Scripts/Components/SaveMenu.cs index 207e0c15..f3b5ac57 100644 --- a/Assets/Fungus/Scripts/Components/SaveMenu.cs +++ b/Assets/Fungus/Scripts/Components/SaveMenu.cs @@ -71,7 +71,14 @@ namespace Fungus instance = this; - GameObject.DontDestroyOnLoad(this); + if (transform.parent == null) + { + GameObject.DontDestroyOnLoad(this); + } + else + { + Debug.LogError("Save Menu cannot be preserved across scene loads if it is a child of another GameObject."); + } clickAudioSource = GetComponent(); }