Beispiel #1
0
        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");
            });
        }
Beispiel #2
0
        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);
            });
        }
 private async void NextStage()
 {
     _stateModel.SetStage(_stateModel.GetStage() + 1);
     _stateModel.SetGameState(GameState.OnPlay);
 }