Exemplo n.º 1
0
 public void ResetScore(int stage)
 {
     playingRecords         = new Stack <PlayingRecord>();
     StageNumber            = stage;
     StageNumberText.text   = string.Format("{0} {1}", LocalizationManager.GetText("StageScene_StageText"), StageNumber);
     BestMoveCountText.text = MapDataManager.GetMapClearCount(stage);
     PlayerData.AddMoveCount(MoveCount);
     MoveCount = 0;
     StageTime = 0;
     UpdateUI();
 }
Exemplo n.º 2
0
    IEnumerator StageClearing()
    {
        SoundManager.PlaySound(SoundManager.Sound.StageClear);
        string bestClearCountString = MapDataManager.GetMapClearCount(StageNumber);
        int    bestClearCount       = bestClearCountString == "?" ? 999 : int.Parse(bestClearCountString);

        if (bestClearCount == MoveCount)
        {
            StartCoroutine(StageClearEffect(3));
        }
        else if (MoveCount > bestClearCount && MoveCount <= bestClearCount * 1.5f)
        {
            StartCoroutine(StageClearEffect(2));
        }
        else if (MoveCount > bestClearCount * 1.5f && MoveCount < bestClearCount * 5)
        {
            StartCoroutine(StageClearEffect(1));
        }

        StageClearInfoSave();
        if (isGoldCubeClear)
        {
            isGoldCubeClear = false;
            if (bestClearCount == MoveCount)
            {
                PlayerData.AddGoldCube(2);
            }
            else
            {
                PlayerData.AddGoldCube(1);
            }
        }
        StageNumber = StageNumber < 100? StageNumber + 1 : 100;
        if (StageNumber > PlayerData.currentStage)
        {
            PlayerData.currentStage = StageNumber;
            PlayerDataSystem.Save();
        }
        yield return(new WaitForSeconds(.5f));

        controller.Jump();
        yield return(new WaitForSeconds(3.0f));

        if (StageNumber != 1)
        {
            if (StageNumber == 50)
            {
                GooglePlayManager.Instance.OnAddAchievement(2);
            }
            GameStart(StageNumber);
            AdMobManager.Instance.ShowInterstitial();
        }
    }
Exemplo n.º 3
0
    void RefreshUI()
    {
        stageSelectCheckPanelTransform.gameObject.SetActive(true);
        for (int i = 0; i < stageSlotList.Count; i++)
        {
            if ((i + 1) > PlayerData.currentStage)
            {
                stageSlotList[i].GetChild(0).GetComponent <Image>().color = PushCubeColor.SlotUnableColor;
            }
            else if ((i + 1) < PlayerData.currentStage)
            {
                stageSlotList[i].GetChild(0).GetComponent <Image>().color = PushCubeColor.SlotColor;
                if (PlayerData.clearStageInfoList[i + 1].totalMove == int.Parse(MapDataManager.GetMapClearCount(i + 1)))
                {
                    stageSlotList[i].GetChild(2).gameObject.SetActive(true);
                }
                else
                {
                    stageSlotList[i].GetChild(2).gameObject.SetActive(false);
                }
            }
            else
            {
                stageSlotList[i].GetChild(0).GetComponent <Image>().color = PushCubeColor.SlotColor;
            }
        }
        foreach (Text txt in GetComponentsInChildren <Text>())
        {
            if (txt.name.Equals("title"))
            {
                txt.color = PushCubeColor.ThemeMainColor;
                continue;
            }
            txt.color = PushCubeColor.ThemeTextColor;
        }

        stageSelectCheckPanelTransform.gameObject.SetActive(false);
        currentPlayingStageNumber = GameManager.instance.StageNumber;
        currentStageText.text     = LocalizationManager.GetText("StageScene_MenuStage_Current") + " " + currentPlayingStageNumber;
        stageParentTransform.GetComponent <RectTransform>().anchoredPosition = new Vector3(Mathf.Clamp(-(256 * (currentPlayingStageNumber - 3)), -256 * stageSlotList.Count, 0), 0, 0);
        if (currentPlayingStageNumber > 0)
        {
            StartCoroutine(CurrentStageAnimation(currentPlayingStageNumber));
        }
    }
Exemplo n.º 4
0
    void CheckGetSpecialCharacter()
    {
        List <CharacterAssets> charList = GameAssetsManager.instance.CharacterAssets.FindAll(x => ItemManager.Instance.IsSpecialCharacter(x.id) && !PlayerData.IsHavingCharacter(x.id));

        foreach (var chr in charList)
        {
            switch (chr.id)
            {
            case 17:
                if (PlayerData.currentStage >= 85)
                {
                    PlayerData.AddCharacter(17);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter17")), null, GameAssetsManager.instance.CharacterAssets[17].asset, null));
                    AddCharToGrid(17);
                }
                break;

            case 18:
                if (hobookGamesClickCount >= 10)
                {
                    GooglePlayManager.Instance.OnAddAchievement(6);
                    PlayerData.AddCharacter(18);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter18")), null, GameAssetsManager.instance.CharacterAssets[18].asset, null));
                    AddCharToGrid(18);
                }
                break;

            case 19:
                if (PlayerData.totalPlayTime >= 180)   // 플레이 타임 3시간
                {
                    PlayerData.AddCharacter(19);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter19")), null, GameAssetsManager.instance.CharacterAssets[19].asset, null));
                    AddCharToGrid(19);
                }
                break;

            case 20:
                if (PlayerData.undoTryCount >= 100 && PlayerData.retryCount >= 100) //취소100번,다시하기100번
                {
                    GooglePlayManager.Instance.OnAddAchievement(5);
                    PlayerData.AddCharacter(20);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter20")), null, GameAssetsManager.instance.CharacterAssets[20].asset, null));
                    AddCharToGrid(20);
                }
                break;

            case 21:
                if (PlayerData.goldCube > 99)
                {
                    PlayerData.AddCharacter(21);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter21")), null, GameAssetsManager.instance.CharacterAssets[21].asset, null));
                    AddCharToGrid(21);
                }
                break;

            case 22:
                if (PlayerData.currentStage == 100)
                {
                    GooglePlayManager.Instance.OnAddAchievement(1);
                    PlayerData.AddCharacter(22);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter22")), null, GameAssetsManager.instance.CharacterAssets[22].asset, null));
                    AddCharToGrid(22);
                }
                break;

            case 23:
                if (PlayerData.currentStage == 100)
                {
                    int cnt = 0;
                    for (int i = 0; i < 100; i++)
                    {
                        if (PlayerData.clearStageInfoList[i + 1].totalMove == int.Parse(MapDataManager.GetMapClearCount(i + 1)))
                        {
                            cnt++;
                        }
                    }
                    if (cnt == 100)
                    {
                        GooglePlayManager.Instance.OnAddAchievement(4);
                        PlayerData.AddCharacter(23);
                        GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter23")), null, GameAssetsManager.instance.CharacterAssets[23].asset, null));
                        AddCharToGrid(23);
                    }
                }
                break;

            case 24:
                if (charList.Count == 1)
                {
                    GooglePlayManager.Instance.OnAddAchievement(3);
                    PlayerData.AddCharacter(24);
                    GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter24")), null, GameAssetsManager.instance.CharacterAssets[24].asset, null));
                    AddCharToGrid(24);
                }
                break;
            }
        }
    }
Exemplo n.º 5
0
    // 리더보드에 점수등록 후 보기
    public void OnShowLeaderBoard()
    {
        bool success = true;

        // 현재 스테이지 랭킹
        Social.ReportScore(PlayerData.currentStage, GPGSIds.leaderboard_current_stage, (bool bSuccess) =>
        {
            success &= bSuccess;
        });
        // 퍼펙트 클리어 랭킹
        Social.ReportScore(PlayerData.clearStageInfoList.FindAll(x => x.stageNumber > 0 && x.totalMove == int.Parse(MapDataManager.GetMapClearCount(x.stageNumber))).Count, GPGSIds.leaderboard_clear_minimum_number_of_moves, (bool bSuccess) =>
        {
            success &= bSuccess;
        });
        // 취소 횟수
        Social.ReportScore(PlayerData.undoTryCount, GPGSIds.leaderboard_total_undo, (bool bSuccess) =>
        {
            success &= bSuccess;
        });
        // 재시도 횟수
        Social.ReportScore(PlayerData.retryCount, GPGSIds.leaderboard_total_retries, (bool bSuccess) =>
        {
            success &= bSuccess;
        });
        // 플레이 타임
        Social.ReportScore((long)PlayerData.totalPlayTime, GPGSIds.leaderboard_total_play_time, (bool bSuccess) =>
        {
            success &= bSuccess;
        });
        if (success)
        {
            Debug.Log("성공");
        }
        else
        {
            Debug.Log("리더보드 열기 실패");
        }
        SoundManager.PlaySound(SoundManager.Sound.AlertPopup);
        Social.ShowLeaderboardUI();
    }
Exemplo n.º 6
0
 string GetTotalPerfectClear()
 {
     return(PlayerData.clearStageInfoList.FindAll(x => x.stageNumber > 0 && x.totalMove == int.Parse(MapDataManager.GetMapClearCount(x.stageNumber))).Count.ToString("N0"));
 }