コード例 #1
0
        public void InputObsavationStart()
        {
            GameManager.Player.CanControl = false;
            _System.DialogResultAsObservable()
            .First()
            .Where(agree => agree)
            .Subscribe(_ =>
            {
                _System.EventDoneAsObservable()
                .Skip(1)
                .First()
                .Subscribe(__ =>
                {
                    SceneChanger.SceneChange(SceneType.StageOne);
                }).AddTo(_System);
                _System.EventDoneAsObservable()
                .DelayFrame(10)
                .First()
                .Subscribe(__ =>
                {
                    _System.TalkStart(TalkMessageReader.GetTalkData(_AfterChoice));
                }).AddTo(_System);
            }).AddTo(_System);

            _System.DialogResultAsObservable()
            .First()
            .Where(agree => !agree)
            .Subscribe(_ =>
            {
                _System.EventDoneAsObservable()
                .First()
                .Subscribe(__ => SceneChanger.SceneChange(SceneType.Title)).AddTo(_System);
            }).AddTo(_System);
            _System.TalkStart(TalkMessageReader.GetTalkData(_BeforeChoice));
        }
コード例 #2
0
        public void Start()
        {
            this.UpdateAsObservable()
            .First(_ => Input.anyKeyDown)
            .Subscribe(_ => system.TalkStart(TalkMessageReader.GetTalkData(Csv)));

            system.EventStartAsObservable().Subscribe(_ => Debug.Log("Eventstart"));
            system.EventDoneAsObservable().Subscribe(_ => Debug.Log("EventDone"));
        }
コード例 #3
0
        public void InputObsavationStart()
        {
            _System.EventDoneAsObservable()
            .First()
            .Subscribe(_ =>
            {
                FadeInOut.Instance.OnFadeCompleteAsObservable()
                .First(fade => fade == Fade.Out)
                .Subscribe(__ =>
                {
                    _Player.SetActive(true);
                    _Player.GetComponent <Player> ().CanControl = false;
                    _Player.GetComponent <Player> ().Controller.BombController.ReminingBombCount.Value = 0;
                    _Rendere.sprite = _AirBackGroundImage;
                    _CloudPrefab.SetActive(true);
                    FadeInOut.Instance.OnFadeCompleteAsObservable()
                    .First(fade => fade == Fade.In)
                    .Subscribe(___ =>
                    {
                        _System.TalkStart(TalkMessageReader.GetTalkData(_CSV2));
                    }).AddTo(_System);
                    FadeInOut.Instance.FadeIn(1f);
                }).AddTo(_System);

                FadeInOut.Instance.FadeOut(1f);
            }).AddTo(_System);

            FadeInOut.Instance.OnFadeCompleteAsObservable()
            .First(fade => fade == Fade.Out)
            .Subscribe(__ =>
            {
                FadeInOut.Instance.OnFadeCompleteAsObservable()
                .First(fade => fade == Fade.In)
                .Subscribe(___ =>
                {
                    _System.TalkStart(TalkMessageReader.GetTalkData(_CSV1));
                }).AddTo(_System);
                _Rendere.sprite = _BaseBackGroundImage;
                FadeInOut.Instance.FadeIn(1f);
            }).AddTo(_System);
            Observable.NextFrame()
            .Delay(TimeSpan.FromSeconds(3f))
            .Subscribe(_ =>
            {
                FadeInOut.Instance.FadeOut(1f);
            }).AddTo(_System);
        }
コード例 #4
0
        public void InputObsavationStart()
        {
            GameManager.Player.CanControl = false;
            _System.EventDoneAsObservable()
            .First()
            .Subscribe(_ =>
            {
                _GuideRenderer.enabled            = true;
                _GuideRenderer.transform.position = _GuideInfo.Position;
                _GuideRenderer.sprite             = _GuideInfo.Sprite;
                var enemyList = new Enemy[_EnemyData.Length];
                for (int i = 0; i < _EnemyData.Length; i++)
                {
                    enemyList[i] = UnityEngine.Object.Instantiate(_EnemyData[i].Enemy, _EnemyData[i].PopPoint, Quaternion.identity);
                }

                GameManager.Player.CanControl = true;

                var enemiesDestroied                    = false;
                var reloaded                            = false;
                var shooted                             = false;
                Func <bool> reload                      = () => reloaded;
                Func <bool> shot                        = () => shooted;
                Func <bool> eliminateEnemies            = () => enemiesDestroied;
                IObservable <Unit> enemiesDestroyStream = enemyList[0].OnDestroyAsObservable();
                for (int i = 1; i < enemyList.Length; i++)
                {
                    enemiesDestroyStream = enemiesDestroyStream.Zip(enemyList[i].OnDestroyAsObservable(), (l, r) => r);
                }
                enemiesDestroyStream.First()
                .Subscribe(__ => enemiesDestroied = true).AddTo(_System);

                GameManager.Player.Controller.FiringController.ReloadAsObservable()
                .First()
                .Subscribe(__ => reloaded = true).AddTo(_System);
                GameManager.Player.Controller.FiringController.ShotAsObservable()
                .First()
                .Subscribe(__ => shooted = true).AddTo(_System);

                _InputObserver.ObsavationCompleteAsObsavable()
                .First()
                .Subscribe(__ => _GuideRenderer.enabled = false).AddTo(_System);
                _InputObserver.ObsavationStart(reload, shot, eliminateEnemies);
            }).AddTo(_System);
            _System.TalkStart(TalkMessageReader.GetTalkData(_CSV));
        }
コード例 #5
0
        public void InputObsavationStart()
        {
            GameManager.Player.CanControl = false;
            _System.EventDoneAsObservable()
            .First()
            .Subscribe(_ =>
            {
                GameManager.Player.Controller.BombController.ReminingBombCount.Value = 2;
                _GuideRenderer.enabled            = true;
                _GuideRenderer.transform.position = _GuideInfo.Position;
                _GuideRenderer.sprite             = _GuideInfo.Sprite;
                GameManager.Player.CanControl     = true;
                var bombLaunched        = false;
                var isAllEnemyDestroied = false;
                GameManager.Player.Controller.BombController.LaunchMissileAsObservable()
                .First()
                .Subscribe(__ =>
                {
                    bombLaunched = true;
                }).AddTo(_System);

                var enemies = new Enemy[_EnemyPopData.Length];
                for (int i = 0; i < _EnemyPopData.Length; i++)
                {
                    enemies[i] = UnityEngine.Object.Instantiate(_EnemyPopData[i].Enemy, _EnemyPopData[i].PopPoint, Quaternion.identity);
                }

                var enemiesDestroyStream = enemies[1].OnDestroyAsObservable();
                for (int i = 1; i < enemies.Length; i++)
                {
                    enemiesDestroyStream.Zip(enemies[i].OnDestroyAsObservable(), (l, r) => r);
                }
                enemiesDestroyStream.First()
                .Subscribe(__ => isAllEnemyDestroied = true).AddTo(_System);
                Func <bool> bombLaunch            = () => bombLaunched;
                Func <bool> checkEliminateEnemies = () => isAllEnemyDestroied;

                _InputObserver.ObsavationCompleteAsObsavable()
                .First()
                .Subscribe(__ => _GuideRenderer.enabled = false).AddTo(_System);
                _InputObserver.ObsavationStart(bombLaunch, checkEliminateEnemies);
            }).AddTo(_System);
            _System.TalkStart(TalkMessageReader.GetTalkData(_CSV));
        }
コード例 #6
0
 public void InputObsavationStart()
 {
     GameManager.Player.CanControl = false;
     _System.EventDoneAsObservable()
     .First()
     .Subscribe(_ =>
     {
         GameManager.Player.CanControl = true;
         Func <bool> up    = () => Input.GetAxis(AxisName.VERTICAL) > 0;
         Func <bool> down  = () => Input.GetAxis(AxisName.VERTICAL) < 0;
         Func <bool> left  = () => Input.GetAxis(AxisName.HORIZONTAL) < 0;
         Func <bool> right = () => Input.GetAxis(AxisName.HORIZONTAL) > 0;
         _GuideRenderer.transform.position = _GuideSprite.Position;
         _GuideRenderer.sprite             = _GuideSprite.Sprite;
         _InputObserver.ObsavationCompleteAsObsavable()
         .First()
         .Subscribe(__ => _GuideRenderer.enabled = false).AddTo(_System);
         _InputObserver.ObsavationStart(up, down, left, right);
     }).AddTo(_System);
     _System.TalkStart(TalkMessageReader.GetTalkData(_Csv));
 }