customer state 로직 수정
This commit is contained in:
parent
63f8e26cb5
commit
56b5f3a701
@ -21,7 +21,6 @@ public class RestaurantCustomerStateSo : ScriptableObject, IGameFlowHandler
|
|||||||
[Title("디버그")]
|
[Title("디버그")]
|
||||||
[ReadOnly, SerializeField] private SpawnSchedule _spawnSchedule;
|
[ReadOnly, SerializeField] private SpawnSchedule _spawnSchedule;
|
||||||
|
|
||||||
private GameStateSo _gameStateSo;
|
|
||||||
private LevelDataSo _levelDataSo;
|
private LevelDataSo _levelDataSo;
|
||||||
private CustomerDataSo _customerDataSo;
|
private CustomerDataSo _customerDataSo;
|
||||||
private CustomerPoolDataSo _customerPoolDataSo;
|
private CustomerPoolDataSo _customerPoolDataSo;
|
||||||
@ -52,13 +51,9 @@ public Task OnExitCurrentFlow(GameFlowState exitingFlowState)
|
|||||||
|
|
||||||
private async Task InitializeRunRestaurant()
|
private async Task InitializeRunRestaurant()
|
||||||
{
|
{
|
||||||
_gameStateSo = await AssetManager.LoadAsset<GameStateSo>(DataConstants.GameStateSo);
|
|
||||||
|
|
||||||
Debug.Assert(_gameStateSo != null, "_gameStateSo is null");
|
|
||||||
|
|
||||||
_iCustomerFactory = new CustomerFactory();
|
_iCustomerFactory = new CustomerFactory();
|
||||||
|
|
||||||
var currentGameLevel = _gameStateSo.GetCurrentLevel();
|
var currentGameLevel = GameStateSo.instance.GameLevelStateSo.Level;
|
||||||
if (_levelDataSo == null)
|
if (_levelDataSo == null)
|
||||||
{
|
{
|
||||||
_levelDataSo = DataManager.Instance.GetDataSo<LevelDataSo>();
|
_levelDataSo = DataManager.Instance.GetDataSo<LevelDataSo>();
|
||||||
@ -80,7 +75,7 @@ private async Task InitializeRunRestaurant()
|
|||||||
|
|
||||||
_spawnLoopCancellationTokenSource?.Cancel();
|
_spawnLoopCancellationTokenSource?.Cancel();
|
||||||
_spawnLoopCancellationTokenSource = new CancellationTokenSource();
|
_spawnLoopCancellationTokenSource = new CancellationTokenSource();
|
||||||
_ = RunSpawnLoopAsync(currentLevelData, normalPool, specialPool, _spawnLoopCancellationTokenSource.Token);
|
await RunSpawnLoopAsync(currentLevelData, normalPool, specialPool, _spawnLoopCancellationTokenSource.Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RunSpawnLoopAsync(LevelData levelData, CustomerPoolData normalPool, CustomerPoolData specialPool, CancellationToken token)
|
private async Task RunSpawnLoopAsync(LevelData levelData, CustomerPoolData normalPool, CustomerPoolData specialPool, CancellationToken token)
|
||||||
|
Loading…
Reference in New Issue
Block a user