リファクタ
This commit is contained in:
parent
fce9a5668f
commit
70e551150a
|
|
@ -148,6 +148,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
this.UpdateAsObservable()
|
this.UpdateAsObservable()
|
||||||
.Where(_ => Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
|
.Where(_ => Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
|
||||||
.Where(_ => menuState.Value == MenuState.Game && state.Value == GameState.Ready)
|
.Where(_ => menuState.Value == MenuState.Game && state.Value == GameState.Ready)
|
||||||
|
.DelayFrame(1)
|
||||||
.Subscribe(_ =>
|
.Subscribe(_ =>
|
||||||
{
|
{
|
||||||
state.Value = GameState.Play;
|
state.Value = GameState.Play;
|
||||||
|
|
@ -203,11 +204,8 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
cameraTransform.position = playerPosX * Vector3.right + cameraOffset;
|
cameraTransform.position = playerPosX * Vector3.right + cameraOffset;
|
||||||
bgManager.ResetBg(playerPosX);
|
bgManager.ResetBg(playerPosX);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
state.Where(x => x == GameState.Play)
|
this.UpdateAsObservable()
|
||||||
.Select(_ => this.UpdateAsObservable())
|
|
||||||
.Switch()
|
|
||||||
.Where(_ => state.Value == GameState.Play)
|
.Where(_ => state.Value == GameState.Play)
|
||||||
.Skip(1)
|
|
||||||
.Subscribe(_ =>
|
.Subscribe(_ =>
|
||||||
{
|
{
|
||||||
if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue