private void Bind() { _nextStageButton.OnClickAsObservable() .TakeUntilDestroy(this) .ThrottleFirst(TimeSpan.FromMilliseconds(500)) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _stateModel.SetStage(_stateModel.GetStage() + 1); _stateModel.SetGameState(GameState.OnPlay); _windowPresenter.OnStateChanged((int)ScreenState.Back); }); _titleButton.OnClickAsObservable() .TakeUntilDestroy(this) .ThrottleFirst(TimeSpan.FromMilliseconds(500)) .Subscribe(_ => { _audioManager.Play(Clip.Cancel); _stateModel.SetGameState(GameState.Non); _windowPresenter.OnStateChanged((int)ScreenState.Reset); }); _tweetButton.OnClickAsObservable() .TakeUntilDestroy(this) .ThrottleFirst(TimeSpan.FromMilliseconds(500)) .Subscribe(_ => { _audioManager.Play(Clip.Apply); // UnityRoomTweet.Tweet ("libertywall_logica", $"ステージ{_stateModel.GetStage() + 1}を{_stateModel.ClickCount}手でクリア。", "unityroom", "unity1week"); }); }
public void OnStart() { _gameStateModel.SetGameState(GameState.OnPlay); foreach (var lightObject in _lightObjects) { lightObject.OnConnect() .TakeUntilDestroy(this) .Subscribe(_ => OnCheckClear()); } }
private void Bind() { _optionButton.OnClickAsObservable() .TakeUntilDestroy(this) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _windowPresenter.OnStateChanged((int)ScreenState.Option); }); _returnTitle.OnClickAsObservable() .TakeUntilDestroy(this) .Subscribe(_ => { _audioManager.Play(Clip.Cancel); _stateModel.SetGameState(GameState.Non); _windowPresenter.OnStateChanged((int)ScreenState.Back); }); var stream = _stateModel.OnGameStateChanged .TakeUntilDestroy(this) .Publish() .RefCount(); stream.Where(_ => _ == GameState.OnClear) .Subscribe(_ => { MoveOut(); Invoke(nameof(NextStage), 2f); }); stream.Where(_ => _ == GameState.OnPlay) .Subscribe(_ => { base.Open(); var sequence = DOTween.Sequence(); sequence.AppendInterval(1f); sequence.Append(_stageLabel.DOFade(1.0f, 1f)); sequence.Append(_stageLabel.DOFade(0.0f, 1f)); sequence.Play(); }); }
private void Bind() { _startButton.OnClickAsObservable() .TakeUntilDestroy(this) .ThrottleFirst(TimeSpan.FromMilliseconds(500)) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _windowPresenter.OnStateChanged((int)ScreenState.Game); _stateModel.SetGameState(GameState.OnPlay); }); _optionButton.OnClickAsObservable() .TakeUntilDestroy(this) .ThrottleFirst(TimeSpan.FromMilliseconds(500)) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _windowPresenter.OnStateChanged((int)ScreenState.Option); }); _plusButton.OnClickAsObservable() .TakeUntilDestroy(this) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _stateModel.SetStage(_stateModel.GetStage() + 1); }); _minusButton.OnClickAsObservable() .TakeUntilDestroy(this) .Subscribe(_ => { _audioManager.Play(Clip.Apply); _stateModel.SetStage(_stateModel.GetStage() - 1); }); }