From 856daae90bb662a489114f1f56459751d37c49de Mon Sep 17 00:00:00 2001 From: kimura Date: Tue, 16 Nov 2021 11:45:36 +0900 Subject: [PATCH] =?UTF-8?q?=E5=BA=83=E5=91=8A=E8=A6=96=E8=81=B4=E6=99=82?= =?UTF-8?q?=E3=80=81SE=E3=81=8C=E3=81=AA=E3=82=8B=E3=81=AE=E3=82=92?= =?UTF-8?q?=E6=8A=91=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scripts/AdManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scripts/AdManager.cs b/popcorn/Assets/MyGame/Scripts/AdManager.cs index 1ce2b7bf..77de5dd6 100644 --- a/popcorn/Assets/MyGame/Scripts/AdManager.cs +++ b/popcorn/Assets/MyGame/Scripts/AdManager.cs @@ -18,7 +18,7 @@ public sealed class AdManager : SingletonMonoBehaviour { private bool _rewardAdFinish = false; private float _timeScale = 0.0f; - + private bool _marketPause; void Awake(){ #if UNITY_EDITOR @@ -132,6 +132,8 @@ public sealed class AdManager : SingletonMonoBehaviour { private void pauseGame(){ SoundManager.Instance.PauseBGM(); SoundManager.Instance.StopSE(); + _marketPause = Market.Instance.IsPause.Value; + Market.Instance.IsPause.Value = true; if(Time.timeScale > 0.0f){ _timeScale = Time.timeScale; // TimeManager.Instance.Stop(); @@ -139,6 +141,11 @@ public sealed class AdManager : SingletonMonoBehaviour { } private void resumeGame(){ SoundManager.Instance.ReplayBGM(); + // キャッシュしていた元の状態に戻す + if (Market.Instance.IsPause.Value) + { + Market.Instance.IsPause.Value = _marketPause; + } if(_timeScale > 0.0f){ Time.timeScale = _timeScale; // TimeManager.Instance.ChangeTimeScale(_timeScale);