void GetAchievementData() { TextAsset file = Resources.Load <TextAsset>("achievementdata"); StreamReader sr = new StreamReader(new MemoryStream(file.bytes)); string data = sr.ReadLine(); _Dic = JSon.Read(data); for (int i = 0; i < StaticMng.Instance._MaxAchievementCount; i++) { StaticMng.Instance._Achive_Name.Add(_Dic["Achieve_Name_" + i.ToString()]); StaticMng.Instance._Achive_Explanation.Add(_Dic["Achieve_Explain_" + i.ToString()]); StaticMng.Instance._Achive_MaxValue.Add(int.Parse(_Dic["Achieve_MaxCount_" + i.ToString()])); StaticMng.Instance._Achive_Reward.Add(int.Parse(_Dic["Achieve_Reward_" + i.ToString()])); StaticMng.Instance._Achive_RewardInfo.Add(_Dic["Achieve_RewardI_" + i.ToString()]); } }
void GetTowerNameData() { TextAsset file = Resources.Load <TextAsset>("instrumentdata"); StreamReader sr = new StreamReader(new MemoryStream(file.bytes)); string data = sr.ReadLine(); _Dic = JSon.Read(data); for (int i = 0; i < 10; i++) { _TowerUpgradeMng._GuitarTowerUpgradeCost.Add(int.Parse(_Dic["Guitar_Cost_" + i.ToString()])); _TowerUpgradeMng._DrumTowerUpgradeCost.Add(int.Parse(_Dic["Bass_Cost_" + i.ToString()])); _TowerUpgradeMng._BassTowerUpgradeCost.Add(int.Parse(_Dic["Drum_Cost_" + i.ToString()])); _TowerUpgradeMng._KeyBoardTowerUpgradeCost.Add(int.Parse(_Dic["KeyBoard_Cost_" + i.ToString()])); } _TowerUpgradeMng._GuitarTowerUpgradeCost.Add(33000); _TowerUpgradeMng._DrumTowerUpgradeCost.Add(33000); _TowerUpgradeMng._BassTowerUpgradeCost.Add(33000); _TowerUpgradeMng._KeyBoardTowerUpgradeCost.Add(33000); }
void DataLoad() { try { string spdata; string achidata; string q = "select Level,NowExp,Gold,UserName,DrumLevel,GuitarLevel,BassLevel,KeyBoardLevel,Volume,UnlockChapter,UnlockSector_1,UnlockSector_2, UnlockSector_3, UnlockSector_4,StagePeak,Achievement,Gem,GuitarRank,DrumRank,BassRank,KeyBoardRank,InfinityGameScore,IdentityNumber,InfinityFastValue from BuskingTest where ID = '" + StaticMng.Instance._UserId + "' and PW = PASSWORD('" + StaticMng.Instance._UserPW + "');"; try { bool getdata = false; MySqlCommand cmd = new MySqlCommand(q, conn); conn.Open(); MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { getdata = true; StaticMng.Instance._Player_Level = int.Parse(reader[0].ToString()); StaticMng.Instance._Player_NowExp = int.Parse(reader[1].ToString()); StaticMng.Instance._Gold = int.Parse(reader[2].ToString()); StaticMng.Instance._UserName = reader[3].ToString(); StaticMng.Instance._DrumTowerLevel = int.Parse(reader[4].ToString()); StaticMng.Instance._GuitarTowerLevel = int.Parse(reader[5].ToString()); StaticMng.Instance._BassTowerLevel = int.Parse(reader[6].ToString()); StaticMng.Instance._KeyBoardTowerLevel = int.Parse(reader[7].ToString()); StaticMng.Instance._Option_Volume = float.Parse(reader[8].ToString()); if (StaticMng.Instance._Option_Volume == 1) { StaticMng.Instance._Option_Volume_Bool = true; } else { StaticMng.Instance._Option_Volume_Bool = false; } StaticMng.Instance._UnLock_Chapter = int.Parse(reader[9].ToString()); StaticMng.Instance._UnLock_Sector[0] = int.Parse(reader[10].ToString()); StaticMng.Instance._UnLock_Sector[1] = int.Parse(reader[11].ToString()); StaticMng.Instance._UnLock_Sector[2] = int.Parse(reader[12].ToString()); StaticMng.Instance._UnLock_Sector[3] = int.Parse(reader[13].ToString()); spdata = reader[14].ToString(); achidata = reader[15].ToString(); StaticMng.Instance._Gem = int.Parse(reader[16].ToString()); StaticMng.Instance._GuitarTowerRank = int.Parse(reader[17].ToString()); StaticMng.Instance._DrumTowerRank = int.Parse(reader[18].ToString()); StaticMng.Instance._BassTowerRank = int.Parse(reader[19].ToString()); StaticMng.Instance._KeyBoardTowerRank = int.Parse(reader[20].ToString()); StaticMng.Instance._InfinityGameScore = int.Parse(reader[21].ToString()); StaticMng.Instance._InfinityScoreIdentity = int.Parse(reader[22].ToString()); StaticMng.Instance._Infinity_FastValue = int.Parse(reader[23].ToString()); Dictionary <string, string> json = new Dictionary <string, string>(); json = JSon.Read(spdata); for (int i = 0; i < StaticMng.Instance._MaximumChapter; i++) { for (int j = 0; j < StaticMng.Instance._MaximumSector[i]; j++) { StaticMng.Instance._StagePeakCount[i, j] = int.Parse(json["sp_" + i.ToString() + "_" + j.ToString()]); } } Dictionary <string, string> achijson = new Dictionary <string, string>(); achijson = JSon.Read(achidata); for (int i = 0; i < StaticMng.Instance._MaxAchievementCount; i++) { StaticMng.Instance._Achive_NowValue[i] = int.Parse(achijson["Achi_NowVal" + i.ToString()]); StaticMng.Instance._Achive_ClearCheck[i] = int.Parse(achijson["Achi_NowInfo" + i.ToString()]); } } //if (getdata) //{ // //Debug.Log("loadsucces"); // //StaticMng.Instance._Stage_Chapter = 1; //} //else // Debug.Log("loadfail"); conn.Close(); } catch (System.Exception ex) { Debug.Log(ex.ToString()); conn.Close(); } } catch (Exception ex) { Debug.Log(ex); } }