From 4b1aa5229a922129e1468adb72010131182c0cfd Mon Sep 17 00:00:00 2001 From: NTG Date: Sun, 17 Aug 2025 21:49:38 +0900 Subject: [PATCH] =?UTF-8?q?GameState=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/GameState/GameStateSo.cs | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameState/GameStateSo.cs b/Assets/_DDD/_Scripts/GameState/GameStateSo.cs index 464623e1f..67134ae2f 100644 --- a/Assets/_DDD/_Scripts/GameState/GameStateSo.cs +++ b/Assets/_DDD/_Scripts/GameState/GameStateSo.cs @@ -1,35 +1,17 @@ using System.Threading.Tasks; +using UnityEditor; using UnityEngine; namespace DDD { [CreateAssetMenu(fileName = "GameStateSo", menuName = "GameState/GameStateSo")] - public class GameStateSo : ScriptableObject, IGameFlowHandler + public class GameStateSo : ScriptableSingleton { - [SerializeField] private int _level = 1; + public GameLevelStateSo GameLevelStateSo { get; private set; } - public Task OnReadyNewFlow(GameFlowState newFlowState) + private void OnEnable() { - if (newFlowState is GameFlowState.None or GameFlowState.ReadyForRestaurant) - { - Initialize(); - } - - return Task.CompletedTask; + GameLevelStateSo = CreateInstance(); } - - public Task OnExitCurrentFlow(GameFlowState exitingFlowState) - { - return Task.CompletedTask; - } - - private void Initialize() - { - // TODO : 저장된 데이터 가져오기 or 없으면 데이터 초기화 - - _level = 1; - } - - public int GetCurrentLevel() => _level; } } \ No newline at end of file