예제 #1
0
 public static void AddGoldCube(int count)
 {
     PlayerData.goldCube         += count;
     PlayerData.getGoldCubeCount += count;
     PlayerDataSystem.Save();
     Debug.Log(count + "의 골큐획득! > " + goldCube);
 }
예제 #2
0
 private void OnApplicationQuit()
 {
     if (isPlayerDataLoad)
     {
         PlayerDataSystem.Save();
         ConfigurationDataSystem.Save();
     }
 }
예제 #3
0
 public static void UseUndoCount()
 {
     if (undoCount > 0)
     {
         PlayerData.undoTryCount++;
         PlayerData.undoCount--;
         PlayerDataSystem.Save();
     }
 }
예제 #4
0
 public void PurchaseRemoveAd()
 {
     PlayerData.isRemoveAd = true;
     PlayerDataSystem.Save();
     PlayerData.AddCharacter(16);
     AdMobManager.Instance.HideBanner();
     GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_BuyRemoveAdYes")), null, GameAssetsManager.instance.CharacterAssets[16].asset, null));
     StartManager.Instance.AddCharToGrid(16);
     Debug.Log("광고 구매완료");
 }
예제 #5
0
 private void UpdateCheckPlayTime()
 {
     playTimeCheckTime += Time.deltaTime;
     if (playTimeCheckTime > 30)
     {
         PlayerData.totalPlayTime += .5f;
         PlayerDataSystem.Save();
         playTimeCheckTime = .0f;
     }
 }
예제 #6
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();
        }
    }
예제 #7
0
    private void StructExecute(List <Vector3> initPositions, List <float> initRadius, Vector3 targetPosition)
    {
        Stopwatch sw = new Stopwatch();

        PlayerDataSystem playerDataSystem = new PlayerDataSystem(initPositions, initRadius);

        sw.Start();
        var count = playerDataSystem.IsCollision(targetPosition, initPositions.Count);

        sw.Stop();
        Debug.Log($"Struct execute finished! Count: {count.Count}, time elapsed: {sw.Elapsed}");
    }
예제 #8
0
 public static void AddCharacter(int characterNumber)
 {
     if (!IsHavingCharacter(characterNumber))
     {
         string havingCharacterDataString = havingCharacters;
         PlayerData.havingCharacters = havingCharacterDataString + "," + characterNumber.ToString();
         PlayerDataSystem.Save();
         Debug.Log(characterNumber + " 캐릭터 획득!");
     }
     else
     {
         Debug.Log("이미 가지고 있는 캐릭터!");
     }
 }
예제 #9
0
 public void SelectCharacter()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit, Mathf.Infinity))
         {
             MapNode node = GetCharNodeFromWorldPoint(hit.transform.position - CharacterTransform.position);
             if (node != null)
             {
                 SoundManager.PlaySound(SoundManager.Sound.CharacterSelect);
                 PlayerData.currentCharacter = node.type;
                 PlayerDataSystem.Save();
             }
         }
     }
 }
예제 #10
0
    public static void UpdateClearStageInfo(List <ClearStageInfo> clearStageList)
    {
        StringBuilder data = new StringBuilder();

        for (int i = 0; i < clearStageList.Count; i++)
        {
            if (i == 0)
            {
                data.Append(clearStageList[i].Serialization());
            }
            else
            {
                data.Append("," + clearStageList[i].Serialization());
            }
        }
        PlayerData.stageInfo = data.ToString();
        PlayerDataSystem.Save();
    }
예제 #11
0
 void LoadData()
 {
     PlayerDataSystem.Load();
     ConfigurationDataSystem.Load();
     ItemManager.Instance.LoadItemData();
 }
예제 #12
0
 public static void Retry()
 {
     PlayerData.retryCount++;
     PlayerDataSystem.Save();
 }
예제 #13
0
 public static void AddUndoCount(int count)
 {
     undoCount += count;
     PlayerDataSystem.Save();
 }
예제 #14
0
 public static void UseGoldCube(int count)
 {
     PlayerData.goldCube -= count;
     PlayerDataSystem.Save();
 }
예제 #15
0
 public static void AddMoveCount(int count)
 {
     PlayerData.moveCount += count;
     PlayerDataSystem.Save();
 }