void NewGame() { // first run toggle _startup = false; Slot = (uint)_allSaves.Length; // create a new save data object and save it currentSaveData = new FPSControlPlayerSaveData("SaveTestA", (int) Slot, 100F); //default scene, spawn point, and health // load first scene Application.LoadLevel("SaveTestA"); }
void LoadGame(uint slot) { // first run toggle _startup = false; Slot = slot; // Obtain the save information currentSaveData = FPSControlPlayerData.LoadPlayerSaveData(slot); // weapon data will be loaded from the temporary cache on player spawn // so knowing this, what we can do is move over our saved data to a temp and let it all work automatically... // load the data FPSControlPlayerWeaponManagerSaveData weaponSave = FPSControlPlayerData.LoadWeaponData(Slot); if (weaponSave != null) // if we have saved weapons data... { FPSControlPlayerData.SaveTempWeaponData(weaponSave); // save it to temp cache Debug.Log("active weapon: " + weaponSave.activeWeaponName); } // load the last saved level Application.LoadLevel(currentSaveData.currentLevelName); }