Example #1
0
    // Use this for initialization
    void Start()
    {
        canvasRankingName.gameObject.SetActive(false);

        rank                = 0;
        pointDrawEndFlg     = false;
        rankingDrawEndFlg   = false;
        rankingNameEndFlg   = true;
        sceneMoveDisplayFlg = false;
        sceneMenuFlg        = false;
        inputEndFlg         = false;

        for (int i = 0; i < 30; ++i)
        {
            recordGetBGMTrig[i] = true;
        }

        //セーブデータから値を取得
        Load();
        //実績の状態も取得
        GetRecord(true);

        //ゲームの結果を確認
        gameScore        = ActionRecordManager.sActionRecord;
        rankingPoint[10] = gameScore.C1WashCount + gameScore.C2WashCount + gameScore.C3WashCount + gameScore.C4WashCount;
        rankingName[10]  = "";

        //取得ポイントを元にせっけんキャラクターとアニメーション切り替え
        ResultSekkenControll.ESekkenNo sekkenNo = ResultSekkenControll.ESekkenNo.No_Sekkenkun;
        selectingChara.SetCharNo((int)SelectingCharactorNo.SOAP);
        if (gameScore.isSekkenChanPlay == true)
        {
            sekkenNo = ResultSekkenControll.ESekkenNo.No_Sekkenchan;
            selectingChara.SetCharNo((int)SelectingCharactorNo.SOAPTYAN);
        }
        if (gameScore.isSekkenKun0Play == true)
        {
            sekkenNo = ResultSekkenControll.ESekkenNo.No_Sekkenkun0;
            selectingChara.SetCharNo((int)SelectingCharactorNo.SOAP0);
        }
        //sekkenNo = ResultSekkenControll.ESekkenNo.No_Sekkenchan;
        sekkenControll.SelectSekkenAndAnimation(sekkenNo, rankingPoint[10]);

        //新しいセーブデータ作成
        playCount++;
        UpdateSaveData();   //内部でランキングをソートしているので注意。

        //セーブ
        Save();
        //実績の状態を再取得
        GetRecord(false);

        //新しいセーブデータと古いセーブデータを確認して実績が今回で解放されたのかチェックする。
        CheckGetRecord();

        //ランキング画面へスコアをセット
        for (int i = 0; i < 9; ++i)
        {
            canvasRanking.SetPoint(rankingPoint[i], i);
            canvasRanking.SetRankName(saveDataManager.LoadData((SaveDataManager.ESaveDataStringNo)i), i);
        }
        //10位以下だった
        if (rank >= 9)
        {
            canvasRanking.SetPoint(rankingPoint[rank], 9);
            canvasRanking.SetScoreRank(9);
            canvasRanking.ChangeActive(true, 9);
        }
        else
        {
            //1~9位にランクイン
            canvasRanking.SetScoreRank(rank);
            canvasRanking.ChangeActive(false, 9);
            rankingNameEndFlg = false;
        }
        //3位以上だったらエフェクト有効化
        bool effectSwitch = false;

        if (rank <= 2)
        {
            effectSwitch = true;
        }
        for (int i = 0; i < rank3EffectList.Count; ++i)
        {
            rank3EffectList[i].SetActive(effectSwitch);
        }

        //BGM再生
        if (BGMManager.Instance != null)
        {
            BGMManager.Instance.PlayBGM("Result_BGM", 0);
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Joystick1Button0))) && Fade.FadeEnd())
        {
            switch (state)
            {
            case Charselect.SELECT:
            {
                //回転が終わっているかキャラが解放されているかチェック
                if (CheckOpenChar(soap.GetCharNo()) && soap.EndRotation())
                {
                    state = Charselect.PLAY;
                    //キャラセレクトからモードセレクトへ移行準備
                    soap.SetEnter();
                    no.SetCharNo(soap.GetCharNo());
                    //表示切替
                    charUI.ChangePause();
                    BGMManager.Instance.PlaySE("Character_Decision");
                    selifu[0].Sleep();
                    selifu[1].Sleep();
                }
                else
                {
                    BGMManager.Instance.PlaySE("Not_Character_Decision");
                    if (soap.EndRotation())
                    {
                        switch (soap.GetCharNo())
                        {
                        case 1:
                            selifu[0].Active();
                            selifu[1].Sleep();
                            break;

                        case 2:
                            selifu[1].Active();
                            selifu[0].Sleep();
                            break;

                        default:
                            break;
                        }
                    }
                }
                break;
            }

            case Charselect.PLAY:
            {
//                        Application.LoadLevel("Main");
                state = Charselect.FADE;
                BGMManager.Instance.PlaySE("Cursor_Decision");
                Fade.ChangeScene("main");
                //プレイモードセット
                SceneData.modeSelect = (PlayModeState)m_playMode.SelectNow;

                break;
            }

            default:
            {
                break;
            }
            }
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            switch (state)
            {
            case Charselect.SELECT:
            {
                Fade.ChangeScene("Menu");
                break;
            }

            case Charselect.PLAY:
            {
                state = Charselect.SELECT;
                charUI.ChangePause();
                break;
            }
            }
        }

        if (state == Charselect.PLAY)
        {
            //1f対応
            if (!CheckOpenChar(soap.GetCharNo()))
            {
                state = Charselect.SELECT;
                charUI.ChangePause();
            }
        }

        switch (soap.GetCharNo())
        {
        case 0:
            name.text   = "せっけんくん";
            status.text = "せっけんくんは\nのうりょくが\nへいきんてきな\nキャラクターだ";
            name.color  = status.color = new Color(0.0f, 0.8f, 1.0f);
            selifu[0].Sleep();
            selifu[1].Sleep();
            break;

        case 1:
            if (soaps[0].active)
            {
                name.text   = "せっけんヒーロー";
                status.text = "せっけんヒーローはスピードが\nはやいので\nテクニックがひつようだ!";

                name.color = status.color = new Color(1.0f, 0.6f, 0.0f);
            }
            else
            {
                name.text = status.text = "";
            }
            break;

        case 2:
            if (soaps[2].active)
            {
                name.text   = "せっけんちゃん";
                status.text = "せっけんちゃんは\nかいふくりょくがたかいが\nうけるダメージがおおきいぞ";
                name.color  = status.color = new Color(1.0f, 0.0f, 0.4f);
            }
            else
            {
                name.text = status.text = "";
            }
            break;

        default:
            break;
        }
    }