示例#1
0
    //
    // ================= Func ================= //
    private void SetStageData(string diff, int stageNum)
    {
        SceneControl.instance.currentStage = stageNum;
        //
        stageName.text = stageNum == 0 ? "Infinite" : "Stage " + stageNum.ToString();
        //
        StageData sd = SceneControl.instance.stageData[diff][stageNum];
        //
        int floorCount      = sd.blocks * 10;
        int unit            = sd.unit;
        int countKindOfMine = 0;

        //
        if (stageNum == 0)
        {
            clearFloor.text = "-";
        }
        else
        {
            clearFloor.text = floorCount.ToString() + "F";
        }
        //
        spdUpCD.text = unit.ToString();
        // Set Clear Text(Row-3)
        int    stageInt   = MyUtility.DiffToInt(diff);
        string bestRecord = SceneControl.instance.saveData.bestRecord[stageInt];

        //
        if (stageNum == 0)
        { // Infinite Stage
            clearTextName.text  = "Your best record";
            clearTextValue.text = bestRecord + "F";
        }
        else
        { // 1 ~ 6 Stage
            clearTextName.text = "Clear";

            /* stageBtnState
             *  0 : locked / 1 : unlock effect / 2 : unlocked / 3 : clear */
            if (SceneControl.instance.saveData.stageBtnState[stageInt][stageNum] == 3)
            {
                clearTextValue.text = "YES";
            }
            else
            {
                clearTextValue.text = "NO";
            }
        }
        //
        int[] mineCountsOfBlock = { sd.pull, sd.push, sd.ghost, sd.thunder, sd.narrow, sd.crash };

        for (int i = 0; i < 6; ++i)
        {
            if (mineCountsOfBlock[i] != 0)
            {
                mineInfoControl.mineIcons[i].SetActive(true);
                int mineCount = mineCountsOfBlock[i] * sd.blocks;
                mineInfoControl.mineCountTexts[i].text = "x" + mineCount.ToString();
                ++countKindOfMine;
            }
            else
            {
                mineInfoControl.mineIcons[i].SetActive(false);
            }
        }
        // "kind(s) of mine"
        string kom = (countKindOfMine == 1) ? " kind of mine" : " kinds of mine";

        kindOfMine.text = countKindOfMine.ToString() + kom;
        // "in 10 floor"
        description.gameObject.SetActive(stageNum == 0);
    }