From 073cca3c48dde128920f672730db28a70fca17fe Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 10 Feb 2022 14:56:06 +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=E3=81=8A=E5=AE=A2?= =?UTF-8?q?=E3=81=95=E3=82=93=E3=81=A8VIP=E5=AE=A3=E4=BC=9D=E3=81=AE?= =?UTF-8?q?=E5=8B=95=E3=81=8D=E3=82=92=E6=AD=A2=E3=82=81=E3=82=8B=E5=87=A6?= =?UTF-8?q?=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 --- .../MyGame/Scenes/marketing/Scripts/CustomerAnimator.cs | 6 ++++++ .../MyGame/Scenes/marketing/Scripts/MarketManager.cs | 3 +++ .../Scenes/marketing/Scripts/VipCustomerButtonView.cs | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/CustomerAnimator.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/CustomerAnimator.cs index 2af282a0..3163c11a 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/CustomerAnimator.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/CustomerAnimator.cs @@ -32,6 +32,7 @@ public class CustomerAnimator : MonoBehaviour [SerializeField] private TextMeshPro wantFlavorAmountText; private readonly ReactiveProperty triggerName = new ReactiveProperty(); + public readonly ReactiveProperty IsPause = new ReactiveProperty(); private void Start() { @@ -40,6 +41,11 @@ public class CustomerAnimator : MonoBehaviour { animator.SetTrigger(x); }).AddTo(this); + IsPause.DistinctUntilChanged().Subscribe(x => + { + animator.speed = x ? 0f : 1f; + orderAnimator.speed = x ? 0f : 1f; + }).AddTo(this); } public void SetTrigger(CustomerMovingType movingType, float duration) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs index 8139d4bf..c5f5e6ab 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs @@ -83,6 +83,7 @@ public class MarketManager : MonoBehaviour market.IsPause.Subscribe(isPause => { + vipCustomerButtonView.IsPause.Value = isPause; // ポーズ中非表示 blueView.SetActive(!isPause); BrotherPinkView.Instance.SetActive(!isPause); @@ -388,6 +389,8 @@ public class MarketManager : MonoBehaviour }).AddTo(customerObject); var customerAnimator = Instantiate(controller.CustomerPrefab, customerObject.transform); + // pause処理 + market.IsPause.Subscribe(x => customerAnimator.IsPause.Value = x).AddTo(customerObject); controller.CurrentMovingType.Subscribe(x => { customerAnimator.SetTrigger(x, controller.DurationDelta); diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/VipCustomerButtonView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/VipCustomerButtonView.cs index b314ce8f..9ee63f57 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/VipCustomerButtonView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/VipCustomerButtonView.cs @@ -15,6 +15,7 @@ namespace MyGame.Scenes.marketing.Scripts [SerializeField] private GameObject vipSpeechBubbleObject; [SerializeField] private Transform vipStayPosTransform; [SerializeField] private float vipMoveSpeed; + public readonly BoolReactiveProperty IsPause = new BoolReactiveProperty(); public IObservable VipButton { get; private set; } private IDisposable timerDisposable; private IDisposable moveDisposable; @@ -29,6 +30,14 @@ namespace MyGame.Scenes.marketing.Scripts VipButton = vipButton.OnClickAsObservable() .Merge(eventTrigger.OnPointerClickAsObservable().AsUnitObservable()) .TakeUntilDestroy(this); + + var bubbleAnimator = vipSpeechBubbleObject.GetComponent(); + IsPause.DistinctUntilChanged().Subscribe(x => + { + bubbleAnimator.speed = x ? 0f : 1f; + buttonAnimator.speed = x ? 0f : 1f; + vipCustomerAnimator.speed = x ? 0f : 1f; + }).AddTo(this); } public void ShowButton(bool animated)