Esempio n. 1
0
        void Init()
        {
            DataMaster.TutorialStart();
            fireNum
            .Subscribe(n =>
            {
                if (n < 0 || DataMaster.gameState == GAME_STATE.Ending)
                {
                    return;
                }
                FetchGameState();
#if UNITY_EDITOR
                fireRemainText.text = "終了まで\n" + fireNum.ToString() + " 発";
#endif
            });
            fieldStatus.nowFeverRate      = gameStatus.InitFeverRate;
            fieldStatus.nowDifficultyRate = gameStatus.difficultyRateEasy;

            if (FireWorks.Length > 0)
            {
                if (gameStatus.isDebugMode)
                {
                    // デバッグモードの時はスペースキーを押したときに花火を発射する
                    this.UpdateAsObservable()
                    .Select(inputed => Input.GetKeyDown("space") || Input.GetKeyDown("a"))
                    .Where(inputed => inputed)
                    .Subscribe(_ =>
                    {
                        FireAfterSetPosition();
                    }).AddTo(gameObject);
                }
                else
                {
                    StartCoroutine(FireTimeLine());
                }
            }
        }