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