35 lines
919 B
C#
35 lines
919 B
C#
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
[CreateAssetMenu(fileName = "GameStateSo", menuName = "GameState/GameStateSo")]
|
|
public class GameStateSo : ScriptableObject, IGameFlowHandler
|
|
{
|
|
[SerializeField] private int _level = 1;
|
|
|
|
public Task OnReadyNewFlow(GameFlowState newFlowState)
|
|
{
|
|
if (newFlowState is GameFlowState.None or GameFlowState.ReadyForRestaurant)
|
|
{
|
|
Initialize();
|
|
}
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task OnExitCurrentFlow(GameFlowState exitingFlowState)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
private void Initialize()
|
|
{
|
|
// TODO : 저장된 데이터 가져오기 or 없으면 데이터 초기화
|
|
|
|
_level = 1;
|
|
}
|
|
|
|
public int GetCurrentLevel() => _level;
|
|
}
|
|
} |