カウンターを肥料演出に対応

This commit is contained in:
kimura 2021-10-29 17:13:11 +09:00
parent 376d3713a4
commit c19d676afa
2 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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<Unit> playEffectObserve = new Subject<Unit>();
@ -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();