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)