From c19d676afaee8f38c6bb4c44f8b7a1312f9330ce Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 29 Oct 2021 17:13:11 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=82=A6=E3=83=B3=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=82=92=E8=82=A5=E6=96=99=E6=BC=94=E5=87=BA=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs | 3 +++ .../MyGame/Scenes/CornField/Scripts/HarvestedAdditionView.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs index 48721e5c..f3be40f8 100644 --- a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs +++ b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs @@ -118,6 +118,7 @@ public class CornField : MonoBehaviour GameDataManager.SaveGameData(); isFertilizing = true; + additionView.IsStopDisapper = true; SoundManager.Instance.PlayBGM("bgm_fertilizer"); brotherFertilizerAnimation.StartAnimation(); // button非表示 @@ -167,6 +168,8 @@ public class CornField : MonoBehaviour this.CallWaitForSeconds(fertilizerFinishWaitTime, () => { isFertilizing = false; + additionView.IsStopDisapper = false; + additionView.PlayEffect(); // ボタン表示復活 promoteGrowthButton.gameObject.SetActive(true); sideButtons.SetActive(true); diff --git a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/HarvestedAdditionView.cs b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/HarvestedAdditionView.cs index 7b328789..eedc0e5c 100644 --- a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/HarvestedAdditionView.cs +++ b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/HarvestedAdditionView.cs @@ -20,6 +20,7 @@ public class HarvestedAdditionView : MonoBehaviour [SerializeField] private float countDuration = .4f; [Tooltip("コーンが来なくなってから待つ時間")] [SerializeField] private float waitDisappeared = 2f; + public bool IsStopDisapper; private static readonly string harvestedCountFormat = "+{0}"; private static readonly string hasCountFormat = "{0}"; private readonly Subject playEffectObserve = new Subject(); @@ -59,11 +60,11 @@ public class HarvestedAdditionView : MonoBehaviour }).AddTo(this); playEffectObserve .Throttle(TimeSpan.FromSeconds(waitDisappeared)) + .Where(_ => !IsStopDisapper) .Subscribe(_ => { endObservable.OnNext(latestCount); SetHarvestedCount(0); - Debug.Log($"corn:{GameDataManager.GameData.CornSeed} {latestCount}"); disapperCoroutine = this.CallWaitForSeconds(countDuration, () => { Reset();