// [SerializeField] // private Text testText; /* * enum TextBlinkType { * Init = 3, * Load = 12, * } */ // Start is called before the first frame update void Start() { QualitySettings.vSyncCount = 0; Application.targetFrameRate = 10; // OshiroRemoteConfig.RemoteConfigInit(); // FirebaseInit(); OshiroFirebases oshiroFirebases = new OshiroFirebases(); oshiroFirebases.Init(); /* * SaveData saveData = new SaveData(); * * StatusInfo statusInfo = saveData.GetStatusInfo(); * Debug.Log("出世経験値(Exp):"+statusInfo.CareerExp); * Debug.Log("身分(Career):"+statusInfo.Career); */ // int currentExp = careerData.Exp; // this.careerText.text = careerData.Career; this.titleAnimator = titleButton.GetComponent <Animator>(); // outputStatusEdit(); // StartCoroutine(GetText()); titleButton.onClick.AddListener(() => gameStart()); helpButton.onClick.AddListener(() => helpOpen()); configButton.onClick.AddListener(() => configOpen()); }
/** * クイズ種類選択 */ private async UniTask SelectQuizType(int selectType) { // 階級挑戦問題説明文の初期化 statusPanelController.OutputCareerDescription(""); // RemoteConfigのFetch日時が古い場合はFetchを行う if (OshiroRemoteConfig.Instance().IsNeedFetch()) { UnityAction callback = () => OshiroRemoteConfig.Instance().RemoteConfigFetch(); OshiroFirebases oshiroFirebases = new OshiroFirebases(); oshiroFirebases.FirebaseAsyncAction(callback); } // 強制アップデートチェック if (OshiroUtil.IsForceUpdate()) { var modalWindow = GameObject.FindWithTag("Modal"); if (modalWindow == null) { var canvas = GameObject.Find("Canvas"); var forceUpdate = Instantiate(this.forceUpdatePrefab); forceUpdate.tag = "Modal"; forceUpdate.transform.SetParent(canvas.transform, false); } return; } // 階級挑戦クイズはメンテナンス中は実施不可 if (OshiroRemoteConfig.Instance().IsMaintenance) { if ((int)GamePlayInfo.QuizType.CareerQuiz == selectType) { statusPanelController.OutputCareerDescription("メンテナンス中のため階級挑戦問題で遊ぶことができません"); return; } } SoundController.instance.QuizStart(); // Loading表示 loadingText.Display(); // ロード中状態に変更 this.quizOutputStatus = QuizOutputStatus.QuizLoad; // 選択したクイズ種類を設定 if ((int)GamePlayInfo.QuizType.RegularQuiz == selectType) { // レギュラークイズ GamePlayInfo.PlayQuizType = GamePlayInfo.QuizType.RegularQuiz; quizMaker = new RegularQuizMaker(); // クイズ情報ロード ((RegularQuizMaker)quizMaker).QuizDataLoad(); } else { // 身分クイズ GamePlayInfo.PlayQuizType = GamePlayInfo.QuizType.CareerQuiz; quizMaker = new CareerQuizMaker(); // クイズ情報ロード bool isSuccess = await this.apiController.CareerQuizLoad((CareerQuizMaker)quizMaker, GamePlayInfo.BeforeCareer); // 失敗時は1回だけリトライ if (!isSuccess) { await UniTask.Delay(2500); isSuccess = await this.apiController.CareerQuizLoad((CareerQuizMaker)quizMaker, GamePlayInfo.BeforeCareer); } // ロードリトライも失敗時 if (!isSuccess) { statusPanelController.OutputCareerDescription("サーバーとの通信に失敗しました。"); // Loading表示の解除 loadingText.Hidden(); // ステータスをクイズ開始前に戻す quizOutputStatus = QuizOutputStatus.BeforeQuiz; return; } } // Loading表示の解除 loadingText.Hidden(); // パネルを切り替え this.selectUIPanel.SetActive(false); this.statusPanelController.DisplayChange(false); this.gameUIPanel.SetActive(true); this.questionPanel.SetActive(true); // 出題状況チェックしてクイズを作成 StartCoroutine(quizOutputCheck()); this.charactorController.QuizStartTrigger(); }