// ---------- ゲーム終了 ----------
    private void EndStart()
    {
        StateStartCommon();
        //結果画面を表示
        uiCanvas.SetActive(false);
        resultCanvas.SetActive(true);
        bestScoreImage.SetActive(false);
        // スコアを設定
        resultScoreText.text = score.ToString();
        // ベストスコアの設定
        float bestScore = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_SCORE);

        if (bestScore == 0 || bestScore < score)
        {
            // ベストスコアの場合、保存する
            GameSystemManager.SetFloat(GameUtil.Const.SAVE_KEY_BEST_SCORE, score);
            bestScoreImage.SetActive(true);
        }
        // スコアの登録(ベストタイムに限らず送信)
        SendScore(score);
        // タワー全体をカメラ視点対象に設定
        cameraController.LookTowerTarget();
        // BGM変更
        assetsManager.PlayBGM(GameUtil.Const.BGM_KEY_MAGGOAL, false);
    }
Ejemplo n.º 2
0
    void Start()
    {
        assetsManager = FindObjectOfType <AssetsManager>();
        // UI部品取得
        startButton             = GameObject.Find(START_BUTTON_NAME);
        timeAttackButton        = GameObject.Find(TIMEATTACK_BUTTON_NAME);
        tutorialDispButton      = GameObject.Find(TUTORIAL_DISP_BUTTON);
        modeCanvas              = GameObject.Find(MODE_CANVAS_NAME);
        timeAttackCanvas        = GameObject.Find(TIMEATTACK_CANVAS_NAME);
        tutorialCanvas          = GameObject.Find(TUTORIAL_CANVAS_NAME);
        episode1Button          = GameObject.Find(EPISODE1_BUTTON_NAME);
        episode2Button          = GameObject.Find(EPISODE2_BUTTON_NAME);
        episode3Button          = GameObject.Find(EPISODE3_BUTTON_NAME);
        episode4Button          = GameObject.Find(EPISODE4_BUTTON_NAME);
        episode5Button          = GameObject.Find(EPISODE5_BUTTON_NAME);
        timeAttackStage1Button  = GameObject.Find(TIMEATTACK_STAGE1_BUTTON_NAME);
        timeAttackStage2Button  = GameObject.Find(TIMEATTACK_STAGE2_BUTTON_NAME);
        timeAttackStage3Button  = GameObject.Find(TIMEATTACK_STAGE3_BUTTON_NAME);
        timeAttackStage4Button  = GameObject.Find(TIMEATTACK_STAGE4_BUTTON_NAME);
        timeAttackStage5Button  = GameObject.Find(TIMEATTACK_STAGE5_BUTTON_NAME);
        clearBestTimeStage1Text = GameObject.Find(CLEAR_BEST_TIME_STAGE1_TEXT_NAME).GetComponent <TextMeshProUGUI>();
        clearBestTimeStage2Text = GameObject.Find(CLEAR_BEST_TIME_STAGE2_TEXT_NAME).GetComponent <TextMeshProUGUI>();
        clearBestTimeStage3Text = GameObject.Find(CLEAR_BEST_TIME_STAGE3_TEXT_NAME).GetComponent <TextMeshProUGUI>();
        clearBestTimeStage4Text = GameObject.Find(CLEAR_BEST_TIME_STAGE4_TEXT_NAME).GetComponent <TextMeshProUGUI>();
        clearBestTimeStage5Text = GameObject.Find(CLEAR_BEST_TIME_STAGE5_TEXT_NAME).GetComponent <TextMeshProUGUI>();
        backGroundMaterial      = GameObject.Find(BACKGROUND_IMAGE_NAME).GetComponent <Renderer>().material;
        titleMaterial           = GameObject.Find(TITLE_IMAGE_NAME).GetComponent <Renderer>().material;
        goroyanMaterial         = GameObject.Find(GOROYAN_IMAGE_NAME).GetComponent <Renderer>().material;

        // スタートボタン表示
        SetStartButtonEnable();
        // ゲーム進行によってボタンの活性/非活性を切替
        episode2Button.GetComponent <Button>().interactable         = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE1);
        episode3Button.GetComponent <Button>().interactable         = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE2);
        episode4Button.GetComponent <Button>().interactable         = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE3);
        episode5Button.GetComponent <Button>().interactable         = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE4);
        timeAttackStage1Button.GetComponent <Button>().interactable = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE1);
        timeAttackStage2Button.GetComponent <Button>().interactable = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE2);
        timeAttackStage3Button.GetComponent <Button>().interactable = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE3);
        timeAttackStage4Button.GetComponent <Button>().interactable = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE4);
        timeAttackStage5Button.GetComponent <Button>().interactable = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE5);
        timeAttackButton.GetComponent <Button>().interactable       = GameSystemManager.GetBool(GameUtil.Const.SAVE_KEY_CLEAR_STAGE1);
        // ベストタイムを取得
        clearBestTimeStage1Text.text = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE1).ToString("n2") + " 秒";
        clearBestTimeStage2Text.text = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE2).ToString("n2") + " 秒";
        clearBestTimeStage3Text.text = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE3).ToString("n2") + " 秒";
        clearBestTimeStage4Text.text = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE4).ToString("n2") + " 秒";
        clearBestTimeStage5Text.text = GameSystemManager.GetFloat(GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE5).ToString("n2") + " 秒";
        // 操作説明を非表示にする
        tutorialCanvas.SetActive(false);

        // タイムアタックモードをOFFにする
        GameSystemManager.timeAttackMode = false;
    }
Ejemplo n.º 3
0
    /// <summary>
    /// タイムアタックモードクリア処理
    /// </summary>
    public void TimeAttackClear()
    {
        switch (SceneManager.GetActiveScene().name)
        {
        case GameUtil.Const.SCENE_NAME_STAGE1:
            clearSceneName  = "ステージ1";
            bestTimeSaveKey = GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE1;
            break;

        case GameUtil.Const.SCENE_NAME_STAGE2:
            clearSceneName  = "ステージ2";
            bestTimeSaveKey = GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE2;
            break;

        case GameUtil.Const.SCENE_NAME_STAGE3:
            clearSceneName  = "ステージ3";
            bestTimeSaveKey = GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE3;
            break;

        case GameUtil.Const.SCENE_NAME_STAGE4:
            clearSceneName  = "ステージ4";
            bestTimeSaveKey = GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE4;
            break;

        case GameUtil.Const.SCENE_NAME_STAGE5:
            clearSceneName  = "ステージ5";
            bestTimeSaveKey = GameUtil.Const.SAVE_KEY_BEST_CLEAR_TIME_STAGE5;
            break;
        }
        // ベストタイムの場合、保存する
        float clearTime = timeCount;
        float bestTime  = GameSystemManager.GetFloat(bestTimeSaveKey);
        bool  boolBest  = false;

        if (bestTime == 0 || bestTime > clearTime)
        {
            GameSystemManager.SetFloat(bestTimeSaveKey, clearTime);
            boolBest = true;
        }
        // クリアシーンへ遷移
        SceneManager.LoadSceneAsync(GameUtil.Const.SCENE_NAME_TIMEATTACK_CLEAR).AsObservable()
        .Subscribe(_ =>
        {
            TimeAttackClearManager clearManager = FindObjectOfType <TimeAttackClearManager>();
            clearManager.clearTime      = clearTime;
            clearManager.clearStageName = clearSceneName;
            clearManager.bestTime       = boolBest;
        });
    }
Ejemplo n.º 4
0
    /// <summary>
    /// スコア設定処理
    /// </summary>
    /// <param name="mode">モード</param>
    /// <param name="score">スコア</param>
    public void SetResultMole(string mode, int score)
    {
        // 言語設定によって設定する画像を切り替える
        SystemLanguage sl = Application.systemLanguage;

        switch (sl)
        {
        // *** 日本語 ***
        case SystemLanguage.Japanese:
            img_mole_bad       = img_mole_bad_ja;
            img_mole_good      = img_mole_good_ja;
            img_mole_perfect   = img_mole_perfect_ja;
            img_majiro_bad     = img_majiro_bad_ja;
            img_majiro_good    = img_majiro_good_ja;
            img_majiro_perfect = img_majiro_perfect_ja;
            break;

        // *** 英語(デフォルト) ***
        case SystemLanguage.English:
        default:
            img_mole_bad       = img_mole_bad_en;
            img_mole_good      = img_mole_good_en;
            img_mole_perfect   = img_mole_perfect_en;
            img_majiro_bad     = img_majiro_bad_en;
            img_majiro_good    = img_majiro_good_en;
            img_majiro_perfect = img_majiro_perfect_en;
            break;
        }
        // モードによって判定スコア、保存キーを切り替える
        int[]  scoreList   = null;
        string bestSaveKey = null;

        switch (mode)
        {
        case GameUtil.Const.MODE_EASY:
            scoreList   = e_ScoreList;
            bestSaveKey = GameUtil.Const.SAVE_KEY_BEST_SCORE_EASY;
            break;

        case GameUtil.Const.MODE_NORMAL:
            scoreList   = n_ScoreList;
            bestSaveKey = GameUtil.Const.SAVE_KEY_BEST_SCORE_NORMAL;
            break;

        case GameUtil.Const.MODE_HARD:
            scoreList   = h_ScoreList;
            bestSaveKey = GameUtil.Const.SAVE_KEY_BEST_SCORE_HARD;
            break;
        }
        // スコアによって画像を切り替える
        if (score == scoreList[0])
        {
            dispSprite = img_mole_perfect;
        }
        else if (score >= scoreList[1])
        {
            dispSprite = img_mole_good;
        }
        else if (score >= 0)
        {
            dispSprite = img_mole_bad;
        }
        else if (score > scoreList[2])
        {
            dispSprite = img_majiro_bad;
        }
        else if (score > scoreList[3])
        {
            dispSprite = img_majiro_good;
        }
        else if (score == scoreList[3])
        {
            dispSprite = img_majiro_perfect;
        }
        // ベストスコアの場合、保存する
        float bestScore = GameSystemManager.GetFloat(bestSaveKey);

        if (bestScore == 0 || bestScore < score)
        {
            GameSystemManager.SetFloat(bestSaveKey, score);
            bestFlg = true;
        }
        // 表示させる
        Invoke("DispResultMole", 1.0f);
    }