From 46feafdcb401f95e4ec28e87d8d46ed9637fca33 Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 9 Jul 2021 10:06:38 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=83=B3=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89(=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E7=94=A8)?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/PopcornGameManager.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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()