// LoadInformation.LoadAllInformation(); public static void LoadAllInformation() { GameInformation.PlayerName = PlayerPrefs.GetString("PLAYERNAME"); GameInformation.PlayerClass = (BaseClass)PlayerPrefSerialization.Load("PLAYERCLASS"); GameInformation.PlayerCPU = PlayerPrefs.GetInt("PLAYERCPU"); GameInformation.Credits = PlayerPrefs.GetInt("CREDITS"); GameInformation.RAM = PlayerPrefs.GetInt("PLAYERRAM"); GameInformation.Strength = PlayerPrefs.GetInt("PLAYERSTRENGTH"); GameInformation.Dexterity = PlayerPrefs.GetInt("PLAYERDEXTERITY"); GameInformation.Intellect = PlayerPrefs.GetInt("PLAYERINTELLECT"); }
//allows all player saved information to be loaded public static void LoadAllInformation() { GameInformation.PlayerLevel = PlayerPrefs.GetInt("PLAYERLEVEL"); GameInformation.PlayerName = PlayerPrefs.GetString("PLAYERNAME"); GameInformation.Stamina = PlayerPrefs.GetInt("STAMINA"); GameInformation.Strength = PlayerPrefs.GetInt("STRENGTH"); GameInformation.Intellect = PlayerPrefs.GetInt("INTELLECT"); GameInformation.Endurance = PlayerPrefs.GetInt("ENDURANCE"); GameInformation.Dexterity = PlayerPrefs.GetInt("DEXTERITY"); if (PlayerPrefs.GetString("EQUIPMENTITEM1") != null) { GameInformation.EquipmentOne = (BaseEquipment)PlayerPrefSerialization.Load("EQUIPMENTITEM1"); } }
//allow for all player information to be saved public static void SaveAllInformation() { PlayerPrefs.SetInt("PLAYERLEVEL", GameInformation.PlayerLevel); PlayerPrefs.SetString("PLAYERNAME", GameInformation.PlayerName); PlayerPrefs.SetInt("STAMINA", GameInformation.Stamina); PlayerPrefs.SetInt("STRENGTH", GameInformation.Strength); PlayerPrefs.SetInt("INTELLECT", GameInformation.Intellect); PlayerPrefs.SetInt("ENDURANCE", GameInformation.Endurance); PlayerPrefs.SetInt("DEXTERITY", GameInformation.Dexterity); if (GameInformation.EquipmentOne != null) { PlayerPrefSerialization.Save("EQUIPMENTITEM1", GameInformation.EquipmentOne); } //for testing Debug.Log("SAVED ALL PLAYER INFORMATION"); }
// break into smaller funcs public static void SaveAllInformation() { PlayerPrefs.SetString("PLAYERNAME", GameInformation.PlayerName); PlayerPrefSerialization.Save("PLAYERCLASS", GameInformation.PlayerClass); PlayerPrefs.SetInt("PLAYERCPU", GameInformation.PlayerCPU); PlayerPrefs.SetInt("CREDITS", GameInformation.Credits); PlayerPrefs.SetInt("PLAYERRAM", GameInformation.RAM); PlayerPrefs.SetInt("PLAYERSTRENGTH", GameInformation.Strength); PlayerPrefs.SetInt("PLAYERDEXTERITY", GameInformation.Dexterity); PlayerPrefs.SetInt("PLAYERINTELLECT", GameInformation.Intellect); SaveCurrentlyEquiped(); Debug.Log("Saved information"); }
public void LoadCurrentlyEquiped() { // Save Defensive Hardware // Shell if (GameInformation.EquipedShell != null) { GameInformation.EquipedShell = (BaseDefensiveHardware)PlayerPrefSerialization.Load("SHELL"); } // Processor if (GameInformation.EquipedProcessor != null) { GameInformation.EquipedProcessor = (BaseDefensiveHardware)PlayerPrefSerialization.Load("PROCESSOR"); } // Expansion 1 if (GameInformation.EquipedExpansion1 != null) { GameInformation.EquipedExpansion1 = (BaseDefensiveHardware)PlayerPrefSerialization.Load("EXPANSION1"); } // Expansion 2 if (GameInformation.EquipedExpansion2 != null) { GameInformation.EquipedExpansion2 = (BaseDefensiveHardware)PlayerPrefSerialization.Load("EXPANSION2"); } // Coroutine if (GameInformation.EquipedCoroutine != null) { GameInformation.EquipedCoroutine = (BaseDefensiveHardware)PlayerPrefSerialization.Load("COROUTINE"); } // Save Offensive Hardware // Main hand if (GameInformation.EquipedMainHand != null) { PlayerPrefSerialization.Load("MAINHAND"); } // Off hand if (GameInformation.EquipedOffHand != null) { PlayerPrefSerialization.Load("OFFHAND"); } }
static public void SaveCurrentlyEquiped() { // Save Defensive Hardware // Shell if (GameInformation.EquipedShell != null) { PlayerPrefSerialization.Save("SHELL", GameInformation.EquipedShell); } // Processor if (GameInformation.EquipedProcessor != null) { PlayerPrefSerialization.Save("PROCESSOR", GameInformation.EquipedProcessor); } // Expansion 1 if (GameInformation.EquipedExpansion1 != null) { PlayerPrefSerialization.Save("EXPANSION1", GameInformation.EquipedExpansion1); } // Expansion 2 if (GameInformation.EquipedExpansion2 != null) { PlayerPrefSerialization.Save("EXPANSION2", GameInformation.EquipedExpansion2); } // Coroutine if (GameInformation.EquipedCoroutine != null) { PlayerPrefSerialization.Save("COROUTINE", GameInformation.EquipedCoroutine); } // Save Offensive Hardware // Main hand if (GameInformation.EquipedMainHand != null) { PlayerPrefSerialization.Save("MAINHAND", GameInformation.EquipedMainHand); } // Off hand if (GameInformation.EquipedOffHand != null) { PlayerPrefSerialization.Save("OFFHAND", GameInformation.EquipedOffHand); } }