畑演出中にレベルアップ演出が入らないようにした

This commit is contained in:
kimura 2022-02-14 17:51:56 +09:00
parent f1d0e27e5e
commit 998e1a1ec1
1 changed files with 7 additions and 3 deletions

View File

@ -57,13 +57,14 @@ public class CornField : MonoBehaviour
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
private readonly Subject<int> resetFertilizerTimer = new Subject<int>();
private bool isFertilizing;
private readonly BoolReactiveProperty isFertilizing = new BoolReactiveProperty();
// Start is called before the first frame update
void Start()
{
compositeDisposable.AddTo(this);
resetFertilizerTimer.AddTo(this);
isFertilizing.AddTo(this);
SoundManager.Instance.PlayBGM("bgm_Main");
// データ
@ -88,6 +89,9 @@ public class CornField : MonoBehaviour
// ハートゲージがフルかつダイアログが開いていない場合レベルアップ
HeartMeter.Instance.FulledHeart
.CombineLatest(isFertilizing, (acc, active) => acc && !active)
.DistinctUntilChanged()
.Where(x => x)
.DelaySubscription(TimeSpan.FromSeconds(.4f))
.Subscribe(_ =>
{
@ -151,13 +155,13 @@ public class CornField : MonoBehaviour
{
GetRewardDialog.ShowCornFieldDialog(() =>
{
isFertilizing.Value = true;
gameData.fertilizerTime = DateTime.UtcNow.AddSeconds(fertilizerWaitTime + fertilizerDuration).ToBinary();
#if UNITY_EDITOR
gameData.fertilizerTime = DateTime.UtcNow.AddSeconds(10 + fertilizerDuration).ToBinary();
#endif
GameDataManager.SaveGameData();
isFertilizing = true;
additionView.IsStopDisapper = true;
SoundManager.Instance.PlayBGM("bgm_fertilizer");
brotherFertilizerAnimation.StartAnimation();
@ -196,7 +200,7 @@ public class CornField : MonoBehaviour
this.CallWaitForSeconds(fertilizerFinishWaitTime, () =>
{
isFertilizing = false;
isFertilizing.Value = false;
additionView.IsStopDisapper = false;
additionView.PlayEffect();
// ボタン表示復活