diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs index e7a0781a..04ee28ec 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs @@ -252,11 +252,15 @@ public class DebugOptionManager : MonoBehaviour .DistinctUntilChanged() .Subscribe(x => { + gameData.AutoCookUsesCount = 0; gameData.AutoCookLevel = autoCookList[x].level; // level1ならチュートリアル復活 if (gameData.AutoCookLevel == 1) { gameData.FinishedFlags &= ~TutorialFlag.AutoCook; + gameData.AutoCookFinishTime = DateTime.UtcNow.ToBinary(); + gameData.AutoCookProducts = Array.Empty(); + gameData.AutoCookUsesCount = 0; } }).AddTo(this); diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs index e12124d7..4a511a72 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs @@ -94,7 +94,11 @@ public class KitchenManager : MonoBehaviour { gameData.FinishedFlags |= TutorialFlag.AutoCook; GameDataManager.SaveGameData(); - autoCookView.ShowDialog(CookState.Ready); + autoCookView.ShowDialog(CookState.Ready, () => + { + remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow); + autoCookView.ResetTimer((int)remainingTime.TotalSeconds, autoCookData.duration); + }); }); return; } @@ -117,6 +121,7 @@ public class KitchenManager : MonoBehaviour autoCookView.ShowDialog(state, () => { + remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow); autoCookView.ResetTimer((int)remainingTime.TotalSeconds, autoCookData.duration); }); }).AddTo(this);