From 8d267befd7f04e250f2b4e52eb6f3cad609e2ee3 Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 10 Feb 2022 14:54:51 +0900 Subject: [PATCH] =?UTF-8?q?Market=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=82=BA=E4=B8=AD=E3=81=AB=E8=B2=A9=E5=A3=B2?= =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=83=B3=E3=81=AE=E5=85=84=E5=BC=9F=E3=82=92?= =?UTF-8?q?=E6=B6=88=E3=81=99=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/marketing/Scripts/BrotherBlueView.cs | 11 +++++++++++ .../Scenes/marketing/Scripts/BrotherPinkView.cs | 8 ++++++++ .../Scenes/marketing/Scripts/MarketManager.cs | 13 ++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) 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);