リファクタ

This commit is contained in:
kimura 2022-07-25 10:51:56 +09:00
parent fce9a5668f
commit 70e551150a
1 changed files with 2 additions and 4 deletions

View File

@ -148,6 +148,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
this.UpdateAsObservable()
.Where(_ => Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
.Where(_ => menuState.Value == MenuState.Game && state.Value == GameState.Ready)
.DelayFrame(1)
.Subscribe(_ =>
{
state.Value = GameState.Play;
@ -203,11 +204,8 @@ namespace MyGame.Scenes.MiniGame.Scripts
cameraTransform.position = playerPosX * Vector3.right + cameraOffset;
bgManager.ResetBg(playerPosX);
}).AddTo(this);
state.Where(x => x == GameState.Play)
.Select(_ => this.UpdateAsObservable())
.Switch()
this.UpdateAsObservable()
.Where(_ => state.Value == GameState.Play)
.Skip(1)
.Subscribe(_ =>
{
if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))