リファクタ

This commit is contained in:
kimura 2022-04-21 16:03:12 +09:00
parent 2cfa5e34d1
commit ff4e5c4f3b
1 changed files with 3 additions and 4 deletions

View File

@ -122,18 +122,17 @@ public class PopcornGameManager : MonoBehaviour
cornManager.SetCornsActive(true);
compositeDisposable.Clear();
cornManager.Result.SkipLatestValueOnSubscribe()
.FirstOrDefault()
.DelayFrame(1) // Disposeタイミング調整
.Take(1)
.Subscribe(result =>
{
state.Value = GameState.Result;
// リザルト表示遅延
this.CallWaitForSeconds(1.2f, () =>
Observable.Timer(TimeSpan.FromSeconds(1.2f)).Subscribe(_ =>
{
LocalCacheManager.Save(CookingResultDataTag, (rarityData, result, new Action(() => cornManager.SetCornsActive(false))));
LocalCacheManager.Save(RestartCallbackTag, new Action(ResetGame));
TransitionManager.Instance.LoadSceneAdditive(GameScenes.CookingResults);
});
}).AddTo(compositeDisposable);
}).AddTo(compositeDisposable);
// 画面タップでスタート