diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs b/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs index 3f6a49d0e..28a990068 100644 --- a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs +++ b/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs @@ -47,7 +47,7 @@ public void ChangeFlow(GameFlowState newFlowState) return; } - EndCurrentFlow(); + _ = EndCurrentFlow(); _ = ReadyNewFlow(newFlowState); } @@ -57,9 +57,14 @@ private bool CanChangeFlow(GameFlowState newFlowState) return true; } - private void EndCurrentFlow() + private async Task EndCurrentFlow() { + var endCurrentFlowState = GameFlowDataSo.CurrentGameState; + foreach (var handler in FlowHandlers) + { + await handler.OnExitCurrentFlow(endCurrentFlowState); + } } private async Task ReadyNewFlow(GameFlowState newFlowState) diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs b/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs deleted file mode 100644 index 5cec95e27..000000000 --- a/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs +++ /dev/null @@ -1,11 +0,0 @@ -// using System.Threading.Tasks; -// using UnityEngine; -// -// namespace DDD -// { -// public abstract class GameFlowTask : ScriptableObject -// { -// public abstract Task OnReadyNewFlow(GameFlowState newFlowState); -// public abstract Task OnExitCurrentFlow(GameFlowState exitingFlowState); -// } -// } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs.meta b/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs.meta deleted file mode 100644 index af1144a50..000000000 --- a/Assets/_DDD/_Scripts/GameFlow/GameFlowTask.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: b072e73316b7d534b8ec18ffa0b8bfa2 \ No newline at end of file