From 4a9bcecd5a4b36c1cf431012c6ec10282abcd580 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 7 Feb 2022 15:47:15 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AE=A3=E4=BC=9D=E5=87=A6=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marketing/Scripts/BrotherPinkView.cs | 24 +++++++++---------- .../Scenes/marketing/Scripts/MarketManager.cs | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs index 38e0bb03..0fd71626 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/BrotherPinkView.cs @@ -89,7 +89,7 @@ public class BrotherPinkView : SingletonMonoBehaviour }).AddTo(this); this.UpdateAsObservable().Subscribe(_ => { - if (waitMove || isMoveLocked || isPromotion) + if (waitMove || isMoveLocked) { return; } @@ -108,7 +108,7 @@ public class BrotherPinkView : SingletonMonoBehaviour moveIndex++; if (moveIndex == selectedMoves.Length) { - if (isTasting) + if (isTasting || isPromotion) { moveIndex = 0; SetPinkMove(); @@ -166,7 +166,6 @@ public class BrotherPinkView : SingletonMonoBehaviour if (animator != null) { animator.ResetTrigger(Normal); - // animator.SetTrigger(move.trigger); setTrigger.OnNext(move.trigger); } if (Vector2.Distance(wayPoint, pinkTransform.localPosition.ToVector2()) < .01f) @@ -204,23 +203,24 @@ public class BrotherPinkView : SingletonMonoBehaviour public void StartPromotion() { + moveLockDispose?.Dispose(); + isMoveLocked = false; + waitMove = false; + isPromotion = true; - animator.ResetTrigger(Normal); - animator.SetTrigger(Promotion); - Vector3 localPosition = RightPos; - localPosition += Vector3.forward * (localPosition.y + Mathf.Abs(walkSideBottomPos)); - pinkTransform.localPosition = localPosition; - pinkTransform.localRotation = Quaternion.Euler(Vector3.zero); + selectedMoves = pinkAdvertiseMoves; + SetPinkMove(); } public void StopPromotion() { - if (animator != null) + if (!isPromotion) { - animator.ResetTrigger(Promotion); + return; } - ResetMove(); isPromotion = false; + selectedMoves = pinkMoves; + SetPinkMove(); } public void StartTasting() diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs index a30f5db8..bf6c2bd6 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs @@ -260,9 +260,10 @@ public class MarketManager : MonoBehaviour { if (isPromotion) { + signBoardView.SetActiveTastingBoard(false); // 宣伝ボタン表示 rewardButtonView.gameObject.SetActive(true); - signBoardView.SetActiveTastingBoard(false); + BrotherPinkView.Instance.StartPromotion(); } else if (gameData.TastingCount > 0) {