広告表示中にSEが鳴らない対策追加

This commit is contained in:
kimura 2021-12-10 12:13:15 +09:00
parent 4d4c4da244
commit 3a801a580e
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
private float _timeScale = 0.0f;
private bool _marketPause;
private bool _cacheSeEnabled;
void Awake(){
#if UNITY_EDITOR
@ -132,6 +133,8 @@ public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
private void pauseGame(){
SoundManager.Instance.PauseBGM();
SoundManager.Instance.StopSE();
_cacheSeEnabled = SoundManager.Instance.IsEnabled(SoundType.SE);
SoundManager.Instance.SaveEnabledSE(false);
_marketPause = Market.Instance.IsPause.Value;
Market.Instance.IsPause.Value = true;
if(Time.timeScale > 0.0f){
@ -141,6 +144,7 @@ public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
}
private void resumeGame(){
SoundManager.Instance.ReplayBGM();
SoundManager.Instance.SaveEnabledSE(_cacheSeEnabled);
// キャッシュしていた元の状態に戻す
if (Market.Instance.IsPause.Value)
{