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);