diff --git a/popcorn/Assets/PopcornGameManager.cs b/popcorn/Assets/PopcornGameManager.cs index f40163a9..87c11ec3 100644 --- a/popcorn/Assets/PopcornGameManager.cs +++ b/popcorn/Assets/PopcornGameManager.cs @@ -4,7 +4,6 @@ using UniRx; using UniRx.Triggers; using UnityEngine; using UnityEngine.EventSystems; -using UnityEngine.SceneManagement; using UnityEngine.UI; public enum GameState @@ -59,6 +58,22 @@ public class PopcornGameManager : MonoBehaviour }).AddTo(this); ResetGame(); + +#if UNITY_EDITOR + this.UpdateAsObservable() + .Where(_ => Input.GetKeyDown(KeyCode.R)) + // 連打防止 + .ThrottleFirst(TimeSpan.FromSeconds(0.1f)) + .Subscribe(_ => UnityEngine.SceneManagement.SceneManager.LoadScene("Cooking")) + .AddTo(this); + + this.UpdateAsObservable() + .Where(_ => Input.GetKeyDown(KeyCode.E)) + // 連打防止 + .ThrottleFirst(TimeSpan.FromSeconds(0.1f)) + .Subscribe(_ => ResetGame()) + .AddTo(this); +#endif } private void ResetUI()