

#UNITY WEB PLAYER DEMOS DOWNLOAD#

PlayerStats.maxMP = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_MaxMP") PlayerStats.currentMP = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_CurrentMP") PlayerStats.maxHP = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_MaxHP") PlayerStats.currentHP = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_CurrentHP") PlayerStats.currentEXP = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_CurrentExp") ayerLevel = PlayerPrefs.GetInt("Player_" + playerStats.charName + "_Level") (false) Įlse if (PlayerPrefs.GetInt("Player_" + playerStats + "_active") = 0) If(PlayerPrefs.GetInt("Player_" + playerStats + "_inactive") = 1) When i load my data i use this code: // load player stats. PlayerPrefs.SetString("Player_" + playerStats.charName + "_EquippedArmr", playerStats.equippedArmr) PlayerPrefs.SetString("Player_" + playerStats.charName + "_EquippedWpn", playerStats.equippedWpn) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_ArmrPwr", playerStats.armrPwr) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_WpnPwr", playerStats.wpnPwr)

PlayerPrefs.SetInt("Player_" + playerStats.charName + "_Defence", fense) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_Strength", playerStats.strenght) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_MaxMP", playerStats.maxMP)

PlayerPrefs.SetInt("Player_" + playerStats.charName + "_CurrentMP", playerStats.currentMP) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_MaxHP", playerStats.maxHP) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_CurrentHP", playerStats.currentHP) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_CurrentExp", playerStats.currentEXP) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_Level", ayerLevel) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_inactive", 1) PlayerPrefs.SetInt("Player_" + playerStats.charName + "_active", 0) Įlse if () When i save my playerprefs i use this code: // save character infoįor (int i = 0 i < playerStats.Length i++) I dont understand how this is possile since they are stored with different keys and values based on if the gameobjects is active or not. so it will set all the gameobjects active or inactive. but when i load the playerprefs it will load for only one key and one value. Unity will store the values with correct key and value i checked regedit. Unity does something weird when i use playerprefs to store an int value if a gameobject is active or inactive in hierarchy.
