public void SaveUserData() { Dictionary <string, string> userData = new Dictionary <string, string>(); userData["xp"] = XP.ToString(); userData["quest"] = QuestManager.MissionID.ToString(); FileManager.WriteToUser(userData); }
public override string ToString() { return(String.Concat(new string[] { " XP ", XP.ToString(), " Gamer Tag ", GamerTag, " first name ", firstName })); }
public void UpdateXP() { XpImage.fillAmount = (float)XP / (float)RequiredXP; XpText.text = XP.ToString() + "/" + RequiredXP.ToString(); }
private void LoadMap() { for (int x = -11; x <= 11; x++) { for (int y = -5; y <= 5; y++) { string tileName = PlayerPrefs.GetString("Grid-X-" + x + "-Y-" + y); Vector3 position = tilemap.CellToWorld(new Vector3Int(x, y, 0)); int XP; if (tileName != "") { switch (tileName[0]) { case 'C': if (tileName[1] == 'h') { if (tileName == "CharacterA") { tilemap.SetTile(new Vector3Int(x, y, 0), characterA); } else if (tileName == "CharacterB") { tilemap.SetTile(new Vector3Int(x, y, 0), characterB); } } else if (tileName[1] == 'o') { tilemap.SetTile(new Vector3Int(x, y, 0), combat); int combatNumber = 0; if (tileName.Length == 7) { combatNumber = Int32.Parse(tileName[6].ToString()); } if (tileName.Length == 8) { combatNumber = Int32.Parse(tileName[6].ToString() + tileName[7].ToString()); } GameObject combatXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); combatXP1.name = "Combat" + combatNumber + "XP"; XP = PlayerPrefs.GetInt("Combat" + combatNumber + "XP"); combatXP1.GetComponent <Text>().text = XP.ToString(); PlayerPrefs.SetString("Combat" + combatNumber + "Coordinates", x.ToString() + y.ToString()); PlayerPrefs.SetString("Grid-X-" + x + "-Y-" + y, "Combat" + combatNumber); } break; case 'M': tilemap.SetTile(new Vector3Int(x, y, 0), miniboss); GameObject minibossXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); minibossXP1.name = "MinibossXP"; XP = PlayerPrefs.GetInt("Miniboss-XP"); minibossXP1.GetComponent <Text>().text = XP.ToString(); break; case 'B': tilemap.SetTile(new Vector3Int(x, y, 0), miniboss); GameObject bossXP1 = Instantiate(combatXP, position, Quaternion.identity, combatXP.transform.parent); bossXP1.name = "BossXP"; XP = PlayerPrefs.GetInt("Boss-XP"); bossXP1.GetComponent <Text>().text = XP.ToString(); break; case 'S': tilemap.SetTile(new Vector3Int(x, y, 0), shop); break; case 'G': tilemap.SetTile(new Vector3Int(x, y, 0), gambler); break; case 'E': if (tileName[1] == 's') { tilemap.SetTile(new Vector3Int(x, y, 0), essence); } break; case 'H': tilemap.SetTile(new Vector3Int(x, y, 0), home); break; } } } } }
public override string ToString() { return(Date.ToShortDateString() + " - " + XP.ToString()); }