RestaurantRunController 오류 수정
This commit is contained in:
parent
cb2970b897
commit
96aa756769
BIN
Assets/_DDD/_Addressables/So/PopupUiState.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Addressables/So/PopupUiState.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Addressables/So/RestaurantCustomerStateSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Addressables/So/RestaurantCustomerStateSo.asset
(Stored with Git LFS)
Binary file not shown.
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a8ae0a4b68a9b94889b9889b63ebacd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset
(Stored with Git LFS)
Binary file not shown.
@ -13,8 +13,8 @@ public enum GameFlowState : uint
|
||||
RunRestaurant = 1u << 1,
|
||||
SettlementRestaurant = 1u << 2,
|
||||
All = 0xFFFFFFFFu
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GameFlowManager : Singleton<GameFlowManager>, IManager
|
||||
{
|
||||
public GameFlowDataSo GameFlowDataSo;
|
||||
@ -28,32 +28,32 @@ public void PreInit()
|
||||
|
||||
public Task Init()
|
||||
{
|
||||
return Task.CompletedTask;;
|
||||
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();
|
||||
|
||||
_ = ReadyNewFlow(newFlowState);
|
||||
await EndCurrentFlow();
|
||||
|
||||
await ReadyNewFlow(newFlowState);
|
||||
}
|
||||
|
||||
|
||||
private bool CanChangeFlow(GameFlowState newFlowState)
|
||||
{
|
||||
return true;
|
||||
@ -62,27 +62,27 @@ private bool CanChangeFlow(GameFlowState newFlowState)
|
||||
private async Task EndCurrentFlow()
|
||||
{
|
||||
var endCurrentFlowState = GameFlowDataSo.CurrentGameState;
|
||||
|
||||
|
||||
foreach (var handler in FlowHandlers)
|
||||
{
|
||||
await handler.OnExitCurrentFlow(endCurrentFlowState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
private async Task OpenFlowScene(GameFlowState newFlowState)
|
||||
{
|
||||
if (GetFlowScene(newFlowState))
|
||||
@ -102,7 +102,7 @@ private bool GetFlowScene(GameFlowState flowState)
|
||||
|
||||
private void StartFlow()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -8,8 +8,8 @@ public class RestaurantRunController : FlowController
|
||||
RestaurantCustomerStateSo _restaurantCustomerStateSo;
|
||||
public override Task InitializeController()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
|
||||
_restaurantCustomerStateSo = RestaurantState.instance.CustomerState;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task InitializeState()
|
||||
|
@ -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>();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user