RestaurantRunController 오류 수정

This commit is contained in:
NTG 2025-08-18 14:09:56 +09:00
parent cb2970b897
commit 96aa756769
7 changed files with 26 additions and 35 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6a8ae0a4b68a9b94889b9889b63ebacd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -31,27 +31,27 @@ public Task Init()
return Task.CompletedTask; ;
}
public void PostInit()
public async void PostInit()
{
if (IsGameStarted() == false)
{
ChangeFlow(GameFlowState.ReadyForRestaurant);
await ChangeFlow(GameFlowState.ReadyForRestaurant);
}
}
private bool IsGameStarted() => GameFlowDataSo.CurrentGameState != GameFlowState.None;
public void ChangeFlow(GameFlowState newFlowState)
public async Task ChangeFlow(GameFlowState newFlowState)
{
if (!CanChangeFlow(newFlowState))
if (CanChangeFlow(newFlowState) == false)
{
Debug.LogError("Can't change flow");
return;
}
_ = EndCurrentFlow();
await EndCurrentFlow();
_ = ReadyNewFlow(newFlowState);
await ReadyNewFlow(newFlowState);
}
private bool CanChangeFlow(GameFlowState newFlowState)
@ -73,13 +73,13 @@ private async Task ReadyNewFlow(GameFlowState newFlowState)
{
GameFlowDataSo.CurrentGameState = newFlowState;
await OpenFlowScene(newFlowState);
foreach (var handler in FlowHandlers)
{
await handler.OnReadyNewFlow(newFlowState);
}
await OpenFlowScene(newFlowState);
StartFlow();
}

View File

@ -8,8 +8,8 @@ public class RestaurantRunController : FlowController
RestaurantCustomerStateSo _restaurantCustomerStateSo;
public override Task InitializeController()
{
_restaurantCustomerStateSo = RestaurantState.instance.CustomerState;
return Task.CompletedTask;
}
public override Task InitializeState()

View File

@ -9,6 +9,7 @@ public class RestaurantState : ScriptableSingleton<RestaurantState>
public RestaurantRunStateSo RunState { get; private set; }
public RestaurantEnvironmentStateSo EnvironmentState { get; private set; }
public RestaurantPlayerStateSo PlayerState { get; private set; }
public RestaurantCustomerStateSo CustomerState { get; private set; }
// TODO : Load from disk(SaveData)
private void OnEnable()
@ -17,6 +18,7 @@ private void OnEnable()
RunState = CreateInstance<RestaurantRunStateSo>();
EnvironmentState = CreateInstance<RestaurantEnvironmentStateSo>();
PlayerState = CreateInstance<RestaurantPlayerStateSo>();
CustomerState = CreateInstance<RestaurantCustomerStateSo>();
}
}
}