Example #1
0
    // === 코드(플레이 데이터·저장, 불러오기) ===================
    // SaveGamePlay() --saveDataHeader(playerName) -세이브시에 자동으로 playerName이 header로 저장
    //                                             -현재State가 LoadLevel이 저장
    public static bool SaveGamePlay()
    {
        try {
            //Debug.Log("SaveData.SaveGamePlay : Start");
            // SaveDataInfo   "SDG_GamePlay"
            SaveDataHeader("SDG_GUEST");
            {               // PlayerData------------------------------------------------------------
                zFoxDataPackString playerData = new zFoxDataPackString();
                //GameData.,,GoldAmount 프로퍼티로 호출과 동시에 json에 저장된다.
                //같이 플레이어의 로컬 playerfabs에 저장시킨다.
                playerData.Add("Player_COIN", GameData.Instance.players[1].coin);          //현재 코인
                playerData.Add("Player_EXP", GameData.Instance.players[1].exp);            //경험치레벨
                playerData.Add("Player_EXPCOUNT", GameData.Instance.players[1].expCount);  //경험치 카운트
                playerData.Add("Player_CARDHAS", GameData.Instance.players[1].cardHas);    //찾은 카드의 수량
                playerData.Add("Player_TROPHY", GameData.Instance.players[1].trophy);
                playerData.PlayerPrefsSetStringUTF8("PlayerData", playerData.EncodeDataPackString());
                Debug.Log(playerData.EncodeDataPackString());
            }

            PlayerPrefs.Save();
            //json에  카드및 카드덱 정보를 저장한다.
            // FileDataManager.Instance.SaveJsonData();

            return(true);
        } catch (System.Exception e) {
            Debug.LogWarning("SaveData.SaveGamePlay : Failed (" + e.Message + ")");
        }
        return(false);
    }
Example #2
0
    public static bool SaveGamePlay()
    {
        try
        {
            Debug.Log("SaveData.SaveGamePlay : Start");

            // SaveDataInfo
            SaveDataHeader("PunchOut_GamePlay");
            { // PlayerData
                zFoxDataPackString playerData = new zFoxDataPackString();
                playerData.Add("Player_PunchOutCnt", punchOutCnt);

                /*
                 * playerData.Add("Player_HP", PlayerController.nowHp);
                 * playerData.Add("Player_Score", PlayerController.score);
                 * playerData.Add("Player_checkPointSceneName", PlayerController.checkPointSceneName);
                 * playerData.Add("Player_checkPointLabelName", PlayerController.checkPointLabelName);
                 * playerData.PlayerPrefsSetStringUTF8("PlayerData", playerData.EncodeDataPackString());
                 */

                Debug.Log(playerData.EncodeDataPackString());
            }
            { // StageData
              //zFoxDataPackString stageData = new zFoxDataPackString();

                /*
                 * zFoxUID[] uidList = GameObject.Find("Stage").GetComponentsInChildren<zFoxUID>();
                 * foreach (zFoxUID uidItem in uidList)
                 * {
                 *  if (uidItem.uid != null && uidItem.uid != "(non)")
                 *  {
                 *      stageData.Add(uidItem.uid, true);
                 *  }
                 * }
                 * stageData.PlayerPrefsSetStringUTF8("StageData_" + Application.loadedLevelName, stageData.EncodeDataPackString());
                 */
                //Debug.Log(stageData.EncodeDataPackString ());
            }
            { // EventData
              /*
               * zFoxDataPackString eventData = new zFoxDataPackString();
               * eventData.Add("Event_KeyItem_A", PlayerController.itemKeyA);
               * eventData.Add("Event_KeyItem_B", PlayerController.itemKeyB);
               * eventData.Add("Event_KeyItem_C", PlayerController.itemKeyC);
               * eventData.PlayerPrefsSetStringUTF8("EventData", eventData.EncodeDataPackString());
               */
              //Debug.Log(playerData.EncodeDataPackString ());
            }
            // Save
            PlayerPrefs.Save();

            Debug.Log("SaveData.SaveGamePlay : End");
            return(true);
        }
        catch (System.Exception e)
        {
            Debug.LogWarning("SaveData.SaveGamePlay : Failed (" + e.Message + ")");
        }
        return(false);
    }
Example #3
0
 public static bool LoadGamePlay(bool allData)
 {
     try {
         // SaveDataInfo
         if (CheckSaveDataHeader("SDG_GUEST"))
         {
             //Debug.Log("SaveData.LoadGamePlay : Start");
             SaveDate = PlayerPrefs.GetString("SaveDataDate");
             if (allData)                   // PlayerData
             {
                 zFoxDataPackString playerData = new zFoxDataPackString();
                 playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8("PlayerData"));
                 GameData.Instance.players[1].coin     = (int)playerData.GetData("Player_Coin");
                 GameData.Instance.players[1].cardHas  = (int)playerData.GetData("Player_CARDHAS");
                 GameData.Instance.players[1].exp      = (int)playerData.GetData("Player_EXP");
                 GameData.Instance.players[1].expCount = (int)playerData.GetData("Player_EXPCOUNT");
                 GameData.Instance.players[1].expCount = (int)playerData.GetData("Player_TROPHY");
             }
             return(true);
         }
     } catch (System.Exception e) {
         Debug.LogWarning("SaveData.LoadGamePlay : Failed (" + e.Message + ")");
     }
     return(false);
 }
Example #4
0
    public static bool LoadHiScore()
    {
        try {
            if (CheckSaveDataHeader("SDG_HiScore"))
            {
                Debug.Log("SaveData.LoadHiScore : Start");

                zFoxDataPackString hiScoreData = new zFoxDataPackString();
                hiScoreData.DecodeDataPackString(hiScoreData.PlayerPrefsGetStringUTF8("HiScoreData"));

                for (int i = 0; i < 10; i++)
                {
                    HiScore[i] = (int)hiScoreData.GetData("Rank" + (i + 1));
                }

                Debug.Log("SaveData.LoadHiScore : End");
            }

            return(true);
        } catch (System.Exception e) {
            Debug.LogWarning("SaveData.LoadHiScore : Failed(" + e.Message + ")");
        }

        return(false);
    }
Example #5
0
 public static bool LoadHiScore()
 {
     Debug.Log("LoadHiScore Come");
     try
     {
         if (CheckSaveDataHeader("SDG_HiScore"))
         {
             Debug.Log("SaveData.LoadHiScore : Start");
             zFoxDataPackString hiscoreData = new zFoxDataPackString();
             hiscoreData.DecodeDataPackString(hiscoreData.PlayerPrefsGetStringUTF8("HiScoreData"));
             Debug.Log(hiscoreData.PlayerPrefsGetStringUTF8("HiScoreData"));
             for (int i = 0; i < HiScore.GetLength(0); i++)
             {
                 HiScore[i, 0] = (string)hiscoreData.GetData("PunchOutCntforRank" + (i + 1));
                 HiScore[i, 1] = (string)hiscoreData.GetData("HiScoreforRank" + (i + 1));
             }
             Debug.Log("SaveData.LoadHiScore : End");
         }
         return(true);
     }
     catch (System.Exception e)
     {
         Debug.Log("LoadHiScore catch");
         Debug.LogWarning("SaveData.LoadHiScore : Failed (" + e.Message + ")");
     }
     return(false);
 }
Example #6
0
    public static bool LoadGamePlay(bool allData)
    {
        try {
            if (CheckSaveDataHeader("SDG_GamePlay"))
            {
                SaveDate = PlayerPrefs.GetString("SaveDataDate");

                if (allData)
                {
                    zFoxDataPackString playerData = new zFoxDataPackString();
                    playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8("PlayerData"));

                    PlayerController.nowHpMax            = (float)playerData.GetData("Player_HPMax");
                    PlayerController.nowHp               = (float)playerData.GetData("Player_HP");
                    PlayerController.score               = (int)playerData.GetData("Player_Score");
                    PlayerController.checkPointEnabled   = (bool)playerData.GetData("Player_checkPointEnabled");
                    PlayerController.checkPointSceneName = (string)playerData.GetData("Player_checkPointSceneName");
                    PlayerController.checkPointLabelName = (string)playerData.GetData("Player_checkPointLabelName");
                }


                if (PlayerPrefs.HasKey("StageData_" + Application.loadedLevelName))
                {
                    zFoxDataPackString stageData = new zFoxDataPackString();
                    stageData.DecodeDataPackString(stageData.PlayerPrefsGetStringUTF8("Stage_" + Application.loadedLevelName));

                    // 아직 이해 안 됨
                    zFoxUID[] uidList = GameObject.Find("Stage").GetComponentsInChildren <zFoxUID>();

                    foreach (zFoxUID uidItem in uidList)
                    {
                        if (uidItem.uid != null && uidItem.uid != "(non)")
                        {
                            if (stageData.GetData(uidItem.uid) == null)
                            {
                                uidItem.gameObject.SetActive(false);
                            }
                        }
                    }
                }

                if (allData)
                {
                    zFoxDataPackString eventData = new zFoxDataPackString();
                    eventData.DecodeDataPackString(eventData.PlayerPrefsGetStringUTF8("EventData"));
                    PlayerController.itemKeyA = (bool)eventData.GetData("Event_KeyItem_A");
                    PlayerController.itemKeyB = (bool)eventData.GetData("Event_KeyItem_B");
                    PlayerController.itemKeyC = (bool)eventData.GetData("Event_KeyItem_C");
                }

                return(true);
            }
        } catch (System.Exception e) {
            Debug.LogError("SaveData.LoadGamePlay : Failed (" + e.Message + ")");
        }

        return(false);
    }
Example #7
0
    public static string LoadContinueSceneName()
    {
        if (CheckSaveDataHeader("SDG_GamePlay")) {
            zFoxDataPackString playerData = new zFoxDataPackString();
            playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8 ("PlayerData"));
            return (string)playerData.GetData ("Player_checkPointSceneName");
        }

        continuePlay = false;
        return "StageA";
    }
Example #8
0
 public static bool Load()
 {
     try {
         zFoxDataPackString playerData = new zFoxDataPackString();
         playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8("playerData"));
         PlayerController.CheckPointNumber =
             (int)playerData.GetData("CheckPointNumber");
         return(true);
     } catch (System.Exception e) {
     }
     return(false);
 }
Example #9
0
    public static string LoadContinueSceneName()
    {
        if (CheckSaveDataHeader("SDG_GamePlay"))
        {
            zFoxDataPackString playerData = new zFoxDataPackString();
            playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8("PlayerData"));
            return((string)playerData.GetData("Player_checkPointSceneName"));
        }

        continuePlay = false;
        return("StageA");
    }
Example #10
0
    public static bool Save()
    {
        try {
            zFoxDataPackString playerData = new zFoxDataPackString();
            //	PlayerController pc = GameObject.Find ("Player").GetComponent<PlayerController> ();
            playerData.Add("CheckPointNumber", PlayerController.CheckPointNumber);

            PlayerPrefs.Save();
            return(true);
        } catch (System.Exception e) {
        }
        return(false);
    }
Example #11
0
    public static bool SaveGamePlay()
    {
        try {
            Debug.Log("SaveData.SaveGamePlay : Start");

            SaveDataHeader("SDG_GamePlay");

            {
                zFoxDataPackString playerData = new zFoxDataPackString();

                playerData.Add("Player_HPMax", PlayerController.nowHpMax);
                playerData.Add("Player_HP", PlayerController.nowHp);
                playerData.Add("Player_Score", PlayerController.score);
                playerData.Add("Player_checkPointEnabled", PlayerController.checkPointEnabled);
                playerData.Add("Player_checkPointSceneName", PlayerController.checkPointSceneName);
                playerData.Add("Player_checkPointLabelName", PlayerController.checkPointLabelName);
                playerData.PlayerPrefsSetStringUTF8("PlayerData", playerData.EncodeDataPackString());
            }

            {
                zFoxDataPackString stageData = new zFoxDataPackString();
                zFoxUID[]          uidList   = GameObject.Find("Stage").GetComponentsInChildren <zFoxUID>();

                foreach (zFoxUID uidItem in uidList)
                {
                    if (uidItem.uid != null && uidItem.uid != "(non)")
                    {
                        stageData.Add(uidItem.uid, true);
                    }
                }

                stageData.PlayerPrefsSetStringUTF8("StageData_" + Application.loadedLevelName, stageData.EncodeDataPackString());
            }

            {
                zFoxDataPackString eventData = new zFoxDataPackString();
                eventData.Add("Event_KeyItem_A", PlayerController.itemKeyA);
                eventData.Add("Event_KeyItem_B", PlayerController.itemKeyB);
                eventData.Add("Event_KeyItem_C", PlayerController.itemKeyC);
                eventData.PlayerPrefsSetStringUTF8("EventData", eventData.EncodeDataPackString());
            }

            PlayerPrefs.Save();

            return(true);
        } catch (System.Exception e) {
            Debug.LogWarning("SaveData.SaveGamePlay : Failed(" + e.Message + ")");
        }

        return(false);
    }
Example #12
0
    public static bool SaveHiScore(int playerScore)
    {
        LoadHiScore();

        try {
            Debug.Log("SaveData.SaveHiScore : Start");

            newRecord = 0;

            PlayerPrefs.Save();

            int[] scoreList = new int[11];

            //없어도 될 듯
            HiScore.CopyTo(scoreList, 0);

            scoreList[10] = playerScore;
            System.Array.Sort(scoreList);
            System.Array.Reverse(scoreList);

            for (int i = 0; i < 10; i++)
            {
                HiScore[i] = scoreList[i];

                if (playerScore == HiScore[i])
                {
                    newRecord = i + 1;
                }
            }

            SaveDataHeader("SDG_HiScore");

            zFoxDataPackString hiScoreData = new zFoxDataPackString();

            for (int i = 0; i < 10; i++)
            {
                hiScoreData.Add("Rank" + (i + 1), HiScore[i]);
            }

            hiScoreData.PlayerPrefsSetStringUTF8("HiScoreData", hiScoreData.EncodeDataPackString());

            PlayerPrefs.Save();
            Debug.Log("SaveData.SaveHiScore : End");
            return(true);
        } catch (System.Exception e) {
            Debug.LogWarning("SaveData.SaveHiScore : Failed(" + e.Message + ")");
        }

        return(false);
    }
Example #13
0
	// === 코드(플레이 데이터·저장, 불러오기) ===================
	public static bool SaveGamePlay() {
		try {
			Debug.Log("SaveData.SaveGamePlay : Start");

			// SaveDataInfo
			SaveDataHeader("SDG_GamePlay");
			{ // PlayerData
				zFoxDataPackString playerData = new zFoxDataPackString();
				playerData.Add ("Player_HPMax", PlayerController.nowHpMax);
				playerData.Add ("Player_HP"	  , PlayerController.nowHp);
				playerData.Add ("Player_Score", PlayerController.score);
				playerData.Add ("Player_checkPointEnabled"	, PlayerController.checkPointEnabled);
				playerData.Add ("Player_checkPointSceneName", PlayerController.checkPointSceneName);
				playerData.Add ("Player_checkPointLabelName", PlayerController.checkPointLabelName);
				playerData.PlayerPrefsSetStringUTF8 ("PlayerData", playerData.EncodeDataPackString ());
				//Debug.Log(playerData.EncodeDataPackString ());
			}
			{ // StageData
				zFoxDataPackString stageData = new zFoxDataPackString();
				zFoxUID[] uidList = GameObject.Find ("Stage").GetComponentsInChildren<zFoxUID> ();
				foreach(zFoxUID uidItem in uidList) {
					if (uidItem.uid != null && uidItem.uid != "(non)") { 
						stageData.Add (uidItem.uid,true);
					}
				}
				stageData.PlayerPrefsSetStringUTF8 ("StageData_" + Application.loadedLevelName, stageData.EncodeDataPackString ());
				//Debug.Log(stageData.EncodeDataPackString ());
			}
			{ // EventData
				zFoxDataPackString eventData = new zFoxDataPackString();
				eventData.Add ("Event_KeyItem_A", PlayerController.itemKeyA);
				eventData.Add ("Event_KeyItem_B", PlayerController.itemKeyB);
				eventData.Add ("Event_KeyItem_C", PlayerController.itemKeyC);
				eventData.PlayerPrefsSetStringUTF8 ("EventData", eventData.EncodeDataPackString ());
				//Debug.Log(playerData.EncodeDataPackString ());
			}
			// Save
			PlayerPrefs.Save ();

			Debug.Log("SaveData.SaveGamePlay : End");
			return true;

		} catch(System.Exception e) {
			Debug.LogWarning("SaveData.SaveGamePlay : Failed (" + e.Message + ")");
		}
		return false;
	}
Example #14
0
    public static bool LoadGamePlay(bool allData)
    {
        try{
            if(CheckSaveDataHeader("SDG_GamePlay")){
                SaveDate = PlayerPrefs.GetString("SaveDataDate");
                if(allData){
                    zFoxDataPackString playerData = new zFoxDataPackString();
                    playerData.DecodeDataPackString(
                        playerData.PlayerPrefsGetStringUTF8("PlayerData"));
                    PlayerController.nowHpMax = (float)playerData.GetData("Player_HPMax");
                    PlayerController.nowHp = (float)playerData.GetData("Player_HP");
                    PlayerController.score = (int)playerData.GetData("Player_Score");
                    PlayerController.checkPointEnabled = (bool)playerData.GetData("Player_checkPointEnabled");
                    PlayerController.checkPointSceneName = (string)playerData.GetData("Player_checkPointSceneName");
                    PlayerController.checkPointLabelName = (string)playerData.GetData("Player_checkPointLabelName");
                }

                if(PlayerPrefs.HasKey("StageData_"+Application.loadedLevelName)){
                    zFoxDataPackString stageData = new zFoxDataPackString();
                    stageData.DecodeDataPackString(stageData.PlayerPrefsGetStringUTF8(
                        "StageData_"+Application.loadedLevelName));

                    zFoxUID[] uidList = GameObject.Find("Stage").GetComponentsInChildren<zFoxUID>();
                    foreach(zFoxUID uidItem in uidList){
                        if(uidItem.uid != null && uidItem.uid != "(non)"){
                            if(stageData.GetData(uidItem.uid)==null){
                                uidItem.gameObject.SetActive(false);
                            }
                        }
                    }

                }
                if(allData){
                    zFoxDataPackString eventData = new zFoxDataPackString();
                    eventData.DecodeDataPackString(
                        eventData.PlayerPrefsGetStringUTF8("EventData"));
                    PlayerController.itemKeyA = (bool)eventData.GetData("Event_KeyItem_A");
                    PlayerController.itemKeyB = (bool)eventData.GetData("Event_KeyItem_B");
                    PlayerController.itemKeyC = (bool)eventData.GetData("Event_KeyItem_C");
                }
                return true;
            }
        }catch(System.Exception e){

        }
        return false;
    }
Example #15
0
    public static bool LoadHiScore()
    {
        try{
            if(CheckSaveDataHeader("SDG_HiScore")){
                zFoxDataPackString hiscoreData= new zFoxDataPackString();
                hiscoreData.DecodeDataPackString(
                    hiscoreData.PlayerPrefsGetStringUTF8("HiScoreData"));
                for(int i=0;i<10;i++){
                    HiScore[i] = (int)hiscoreData.GetData("Rank"+(i+1));
                }
            }
            return true;
        }catch(System.Exception e){

        }
        return false;
    }
Example #16
0
    // === コード(ハイスコアデータ・セーブロード) ================
    public static bool SaveHiScore(int playerScore)
    {
        LoadHiScore ();

        try {
            Debug.Log("SaveData.SaveHiScore : Start");
            // Hiscore Set & Sort
            newRecord = 0;
            int[] scoreList = new int [11];
            HiScore.CopyTo (scoreList, 0);
            scoreList[10] = playerScore;
            System.Array.Sort(scoreList);
            System.Array.Reverse(scoreList);
            for(int i = 0;i < 10;i ++) {
                HiScore[i] = scoreList[i];
                if (playerScore == HiScore[i]) {
                    newRecord = i + 1;
                }
            }

            // Hiscore Save
            SaveDataHeader("SDG_HiScore");
            zFoxDataPackString hiscoreData = new zFoxDataPackString();
            for(int i = 0;i < 10;i ++) {
                hiscoreData.Add ("Rank" + (i + 1), HiScore[i]);
            }
            hiscoreData.PlayerPrefsSetStringUTF8 ("HiScoreData", hiscoreData.EncodeDataPackString ());

            PlayerPrefs.Save ();
            Debug.Log("SaveData.SaveHiScore : End");
            return true;
        } catch(System.Exception e) {
            Debug.LogWarning("SaveData.SaveHiScore : Failed (" + e.Message + ")");
        }

        return false;
    }
Example #17
0
 public static bool LoadHiScore()
 {
     try {
         if (CheckSaveDataHeader("SDG_HiScore")) {
             Debug.Log("SaveData.LoadHiScore : Start");
             zFoxDataPackString hiscoreData = new zFoxDataPackString();
             hiscoreData.DecodeDataPackString(hiscoreData.PlayerPrefsGetStringUTF8 ("HiScoreData"));
             //Debug.Log(hiscoreData.PlayerPrefsGetStringUTF8 ("HiScoreData"));
             for(int i = 0;i < 10;i ++) {
                 HiScore[i] = (int)hiscoreData.GetData ("Rank" + (i + 1));
             }
             Debug.Log("SaveData.LoadHiScore : End");
         }
         return true;
     } catch(System.Exception e) {
         Debug.LogWarning("SaveData.LoadHiScore : Failed (" + e.Message + ")");
     }
     return false;
 }
Example #18
0
    public static bool LoadGamePlay(bool allData)
    {
        try
        {
            // SaveDataInfo
            if (CheckSaveDataHeader("SDG_GamePlay"))
            {
                Debug.Log("SaveData.LoadGamePlay : Start");
                SaveDate = PlayerPrefs.GetString("SaveDataDate");
                if (allData)
                { // PlayerData
                    zFoxDataPackString playerData = new zFoxDataPackString();
                    playerData.DecodeDataPackString(playerData.PlayerPrefsGetStringUTF8("PlayerData"));
                    Debug.Log(playerData.PlayerPrefsGetStringUTF8("PlayerData"));

                    punchOutCnt = (int)playerData.GetData("Player_PunchOutCnt");

                    /*
                     * PlayerController.nowHp = (float)playerData.GetData("Player_HP");
                     * PlayerController.score = (int)playerData.GetData("Player_Score");
                     * PlayerController.checkPointEnabled = (bool)playerData.GetData("Player_checkPointEnabled");
                     * PlayerController.checkPointSceneName = (string)playerData.GetData("Player_checkPointSceneName");
                     * PlayerController.checkPointLabelName = (string)playerData.GetData("Player_checkPointLabelName");
                     */
                }
                // StageData
                if (PlayerPrefs.HasKey("StageData_" + SceneManager.GetActiveScene().name))
                {
                    //zFoxDataPackString stageData = new zFoxDataPackString();
                    //stageData.DecodeDataPackString(stageData.PlayerPrefsGetStringUTF8("StageData_" + SceneManager.GetActiveScene().name));
                    //Debug.Log(stageData.PlayerPrefsGetStringUTF8 ("StageData_" + Application.loadedLevelName));

                    /*
                     * zFoxUID[] uidList = GameObject.Find("Stage").GetComponentsInChildren<zFoxUID>();
                     * foreach (zFoxUID uidItem in uidList)
                     * {
                     *  if (uidItem.uid != null && uidItem.uid != "(non)")
                     *  {
                     *      if (stageData.GetData(uidItem.uid) == null)
                     *      {
                     *          uidItem.gameObject.SetActive(false);
                     *      }
                     *  }
                     * }
                     */
                }
                if (allData)
                { // EventData
                  //zFoxDataPackString eventData = new zFoxDataPackString();
                  //eventData.DecodeDataPackString(eventData.PlayerPrefsGetStringUTF8("EventData"));
                  //Debug.Log(playerData.PlayerPrefsGetStringUTF8 ("PlayerData"));

                    /*
                     * PlayerController.itemKeyA = (bool)eventData.GetData("Event_KeyItem_A");
                     * PlayerController.itemKeyB = (bool)eventData.GetData("Event_KeyItem_B");
                     * PlayerController.itemKeyC = (bool)eventData.GetData("Event_KeyItem_C");
                     */
                }
                Debug.Log("SaveData.LoadGamePlay : End");
                return(true);
            }
        }
        catch (System.Exception e)
        {
            Debug.LogWarning("SaveData.LoadGamePlay : Failed (" + e.Message + ")");
        }
        return(false);
    }
Example #19
0
    // punchoutcnt - playerControl에 있음.
    // playerSocre - Timer 에 있음.

    public static bool SaveHiScore(string punchOutCnt, string playerScore)
    {
        Debug.Log("SaveDataClass come?");
        Debug.Log("playerScore : " + playerScore + " punchOutCnt : " + punchOutCnt);
        Debug.Log("HiScore[0,0]" + HiScore[0, 0]);

        LoadHiScore();
        //i기존 기록 3등 안에 들었을 경우 넣어주기!
        // int ranking = 0 ; // 갱신된 순위 알려주는 거
        bool flag = false;

        Debug.Log("HiScore.GetLength(0)" + HiScore.GetLength(0));
        for (int i = 1; i < HiScore.GetLength(0); i++)
        {
            Debug.Log("for(int i = 1; i<HiScore.GetLength(0); i++) -> " + i);

            if (Convert.ToInt32(HiScore[i, 1]) > Convert.ToInt32(playerScore))
            {
                flag = true;
            }
        }
        Debug.Log("flag : " + flag);
        // 기존 기록보다 좋지 않은 경우엔 아래 코드들을 실행시키지 않고 리턴 시켜준다.
        if (flag == false)
        {
            Debug.Log("flag : " + flag);

            return(false);
        }

        try
        {
            Debug.Log("SaveData.SaveHiScore : Start");
            // Hiscore Set & Sort
            newRecord = 0;
            Debug.Log("Before HiScore.Length");
            string[,] scoreList = new string[4, 2] {
                { "0", "9998" }, { "0", "9998" }, { "0", "9998" }, { "0", "9998" }
            };;
            Debug.Log("After HiScore.Length");


            //HiScore.CopyTo(scoreList, 0);

            for (int i = 0; i < HiScore.GetLength(0); i++)
            {
                Debug.Log("before : scoreList[i] : " + scoreList[i, 1].ToString());
                scoreList[i, 0] = HiScore[i, 0];
                scoreList[i, 1] = HiScore[i, 1];

                Debug.Log("after : scoreList[i] : " + scoreList[i, 1].ToString());
            }


            Debug.Log("After HiScore.CopyTo(scoreList,0)");

            scoreList[scoreList.GetLength(0) - 1, 0] = punchOutCnt;
            scoreList[scoreList.GetLength(0) - 1, 1] = playerScore;

            Debug.Log("Before Sort ScoreList");

            for (int i = 0; i < scoreList.GetLength(0); i++)
            {
                Debug.Log("scoreList[i,1] : " + scoreList[i, 1]);
            }

            //Sort ScoreList
            for (int i = 0; i < scoreList.GetLength(0) - 1; i++)
            {
                for (int j = 1; j < scoreList.GetLength(0) - i; j++)
                {
                    if (Convert.ToInt32(scoreList[j - 1, 1]) > Convert.ToInt32(scoreList[j, 1]))
                    {
                        swap(scoreList, j);
                    }
                }
            }

            Debug.Log("After Sort ScoreList");
            for (int i = 0; i < scoreList.GetLength(0); i++)
            {
                Debug.Log("scoreList[i,1] : " + scoreList[i, 1]);
            }

            for (int i = 0; i < HiScore.GetLength(0); i++)
            {
                Debug.Log("before : HiScore[i] : " + HiScore[i, 1].ToString());
                HiScore[i, 0] = scoreList[i, 0];
                HiScore[i, 1] = scoreList[i, 1];

                Debug.Log("after : HiScore[i] : " + HiScore[i, 1].ToString());
            }


            // Hiscore Save
            SaveDataHeader("SDG_HiScore");
            zFoxDataPackString hiscoreData = new zFoxDataPackString();
            for (int i = 0; i < HiScore.GetLength(0); i++)
            {
                hiscoreData.Add("PunchOutCntforRank" + (i + 1), HiScore[i, 0]);
                hiscoreData.Add("HiScoreforRank" + (i + 1), HiScore[i, 1]);
            }
            hiscoreData.PlayerPrefsSetStringUTF8("HiScoreData", hiscoreData.EncodeDataPackString());

            PlayerPrefs.Save();
            LoadHiScore();
            for (int i = 0; i < HiScore.GetLength(0); i++)
            {
                Debug.Log("HiScore[i,1] : " + HiScore[i, 1]);
            }

            Debug.Log("SaveData.SaveHiScore : End");


            //Debug.Log("After Clearing stage cnt : "+SaveData.punchOutCnt);

            return(true);
        }
        catch (System.Exception e)
        {
            Debug.LogWarning("SaveData.SaveHiScore : Failed (" + e.Message + ")");
        }

        return(false);
    }