diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherBlueView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherBlueView.cs index 26353b09..5db6573f 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherBlueView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherBlueView.cs @@ -9,6 +9,12 @@ public class BrotherBlueView : MonoBehaviour private static readonly int CleaningB = Animator.StringToHash("CleaningB"); private static readonly int MoveSideways = Animator.StringToHash("MoveSideways"); private static readonly int[] CloseTriggerArray = {CleaningA, CleaningB, MoveSideways}; + private Vector3 initScale; + + private void Awake() + { + initScale = transform.localScale; + } public void SellAction() { @@ -24,4 +30,9 @@ public class BrotherBlueView : MonoBehaviour { animator.SetTrigger(CloseTriggerArray.RandomChoose()); } + + public void SetActive(bool active) + { + transform.localScale = active ? initScale : Vector3.zero; + } } diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs index 0fd71626..d0f5a42a 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs @@ -263,4 +263,12 @@ public class BrotherPinkView : SingletonMonoBehaviour waitMove = false; SetPinkMove(); } + + public void SetActive(bool active) + { + if (animator != null) + { + animator.transform.localScale = active ? Vector3.one : Vector3.zero; + } + } } diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs index bf6c2bd6..8139d4bf 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs @@ -80,13 +80,24 @@ public class MarketManager : MonoBehaviour CoinManager.Instance.ChangeCoin(gameData.Coin); HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + + market.IsPause.Subscribe(isPause => + { + // ポーズ中非表示 + blueView.SetActive(!isPause); + BrotherPinkView.Instance.SetActive(!isPause); + }).AddTo(this); // ハートゲージがフルかつダイアログが開いていない場合レベルアップ HeartMeter.Instance.FulledHeart .DelaySubscription(TimeSpan.FromSeconds(.4f)) .Subscribe(_ => { - ShopLevelUp.ShowDialog(gameData.ViewedShopLevel + 1); + market.IsPause.Value = true; + ShopLevelUp.ShowDialog(gameData.ViewedShopLevel + 1, () => + { + market.IsPause.Value = false; + }); }).AddTo(this); productDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ProductDataSheet);