Exemplo n.º 1
0
    void OnSelectStage(int stage)
    {
        if (selectStage > 0)
        {
            stageSlotList[selectStage - 1].GetChild(0).GetComponent <Image>().color = PushCubeColor.SlotColor;
            selectStage = 0;
        }
        if (stage > PlayerData.currentStage)
        {
            SoundManager.PlaySound(SoundManager.Sound.MenuMiss);
            stageSelectCheckPanelTransform.GetChild(0).GetComponent <Text>().enabled = false;
            stageSelectCheckPanelTransform.GetChild(1).GetComponent <Text>().text    = string.Format("{0}", LocalizationManager.GetText("StageScene_MenuStage_UnableStage"));
            stageSelectCheckPanelTransform.GetChild(2).gameObject.SetActive(false);
            stageSelectCheckPanelTransform.gameObject.SetActive(true);
        }
        else if (stage == currentPlayingStageNumber)
        {
            stageSelectCheckPanelTransform.gameObject.SetActive(false);
        }
        else
        {
            SoundManager.PlaySound(SoundManager.Sound.MenuClick);
            selectStage = stage;

            ClearStageInfo clearStageInfo = PlayerData.clearStageInfoList.Find(x => x.stageNumber == selectStage);
            if (clearStageInfo != null)
            {
                stageSelectCheckPanelTransform.GetChild(0).GetComponent <Text>().enabled = true;
                stageSelectCheckPanelTransform.GetChild(0).GetComponent <Text>().text    = ConfigurationData.language == 0 ? string.Format("<b>최고 기록</b>   시간 <color='#FF8364'><size='45'>{0}</size></color>     이동 <color='#FF8364'><size='45'>{1}</size></color>     완료 <color='#FF8364'><size='45'>{2}</size></color>", clearStageInfo.GetClearTime(), clearStageInfo.totalMove, clearStageInfo.clearCount) : string.Format("<b>Best Record</b>   Time <color='#FF8364'><size='45'>{0}</size></color>     Move <color='#FF8364'><size='45'>{1}</size></color>     Clear <color='#FF8364'><size='45'>{2}</size></color>", clearStageInfo.GetClearTime(), clearStageInfo.totalMove, clearStageInfo.clearCount);
            }
            else
            {
                stageSelectCheckPanelTransform.GetChild(0).GetComponent <Text>().enabled = false;
            }
            stageSelectCheckPanelTransform.GetChild(1).GetComponent <Text>().text = ConfigurationData.language == 0 ? string.Format("{0} {1} ?", selectStage, LocalizationManager.GetText("StageScene_MenuStage_StartStage")) : string.Format("{0} {1} ?", LocalizationManager.GetText("StageScene_MenuStage_StartStage"), selectStage);
            stageSelectCheckPanelTransform.GetChild(2).gameObject.SetActive(true);
            stageSelectCheckPanelTransform.gameObject.SetActive(true);
            stageSlotList[selectStage - 1].GetChild(0).GetComponent <Image>().color = PushCubeColor.SlotSelectColor;
        }
    }
Exemplo n.º 2
0
    void StageClearInfoSave()
    {
        List <ClearStageInfo> clearInfo        = PlayerData.clearStageInfoList;
        ClearStageInfo        currentStageInfo = clearInfo.Find(x => x.stageNumber == StageNumber);

        if (currentStageInfo != null)
        {
            currentStageInfo.clearCount++;
            if (MoveCount < currentStageInfo.totalMove)
            {
                currentStageInfo.totalMove = MoveCount;
            }
            if (StageTime < currentStageInfo.clearTime)
            {
                currentStageInfo.clearTime = StageTime;
            }
        }
        else
        {
            ClearStageInfo newClearStageInfo = new ClearStageInfo(StageNumber, MoveCount, 0, 1, StageTime);
            clearInfo.Add(newClearStageInfo);
        }
        PlayerData.UpdateClearStageInfo(clearInfo);
    }