From b3caa8e7894993e6a3b7353547681f9938afdf8f Mon Sep 17 00:00:00 2001 From: "aube.lee" Date: Wed, 26 Feb 2025 01:21:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20UnityEditor=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gameton-06/Assets/Gameton/Scripts/Common/Main.cs | 3 ++- Gameton-06/Assets/Gameton/Scripts/UI/OptionUI.cs | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/Common/Main.cs b/Gameton-06/Assets/Gameton/Scripts/Common/Main.cs index 7cf75be3..69c435e1 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Common/Main.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Common/Main.cs @@ -13,6 +13,7 @@ namespace TON Title, Lobby, Stage, + Shop, } public class Main : SingletonBase
@@ -49,7 +50,7 @@ namespace TON bool isSceneChangeProgress = false; SceneBase currentSceneController = null; - SceneType currentSceneType = SceneType.None; + public SceneType currentSceneType = SceneType.None; public void ChangeScene(SceneType sceneType, System.Action onSceneChangeCompletedCallback = null) { if (isSceneChangeProgress) diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/OptionUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/OptionUI.cs index 6556a983..c50af75b 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/OptionUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/OptionUI.cs @@ -19,9 +19,10 @@ namespace TON // 상점 : 골드/생선 private void OnEnable() { - Scene activeScene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene(); + // Scene activeScene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene(); + SceneType activeScene = Main.Singleton.currentSceneType; - if (activeScene.name.Equals("Lobby")) + if (activeScene == SceneType.Lobby) { goldObject.SetActive(true); fishObject.SetActive(true); @@ -29,7 +30,7 @@ namespace TON settingObject.SetActive(true); parseObject.SetActive(false); } - else if (activeScene.name.StartsWith("Stage")) + else if (activeScene == SceneType.Stage) { goldObject.SetActive(false); fishObject.SetActive(false); @@ -37,7 +38,7 @@ namespace TON settingObject.SetActive(false); parseObject.SetActive(true); } - else if (activeScene.name.Equals("Shop")) + else if (activeScene == SceneType.Shop) { goldObject.SetActive(true); fishObject.SetActive(true);