public void SaveGame(bool upgrades, bool stats) { if (!upgrades) { SaveLoadMaster.SaveProgress(currentLevel, masterMoney); } else { Upgrades ups = this.GetComponent <Upgrades>(); if (!stats) { SaveLoadMaster.SaveProgress(currentLevel, masterMoney, new int[3] { ups.aimSpeedLVL, ups.fireSpeedLVL, ups.pullPowerLVL }, new bool[6] { ups.Hooksize, ups.scannerUpgrade, ups.aimUpgrade, ups.BackGrab, ups.Destroyer, ups.autograb }); } else { EndGameStats gamestats = this.GetComponent <EndGameStats>(); SaveLoadMaster.SaveProgress(currentLevel, masterMoney, new int[3] { ups.aimSpeedLVL, ups.fireSpeedLVL, ups.pullPowerLVL }, new bool[6] { ups.Hooksize, ups.scannerUpgrade, ups.aimUpgrade, ups.BackGrab, ups.Destroyer, ups.autograb }, new int[] { gamestats.totalCash, gamestats.orescollected, gamestats.bombesExploded, gamestats.oresenriched, gamestats.upgradespurchased }); } } }
public void LoadGame() { SaveLoadMaster.ProgressData pdata = SaveLoadMaster.LoadProgress(); currentLevel = pdata.curLevel; masterMoney = pdata.cashamount; this.GetComponent <Upgrades>().SetSavedGrades(pdata.boostUpgrades, pdata.activeUpgrades); this.GetComponent <EndGameStats>().UnpackStats(pdata.gameStats); }
public void NewGame() {// reset stats SaveLoadMaster.SaveProgress(0, 0, new int[3] { 0, 0, 0 }, new bool[6] { false, false, false, false, false, false }, new int[5] { 0, 0, 0, 0, 0 }); }
private IEnumerator SaveGame(Audio saveAudio) { ActiveSaveImage(true); //show save image AudioManager.Instance.Play(saveAudio); //play save sound SaveLoadMaster.SaveGeneralData(); SaveLoadMaster.SavePlayerData(); yield return(new WaitForSecondsRealtime(2f)); ActiveSaveImage(false); //hide save image }
public void LoadScene() { var sceneToLoad = SaveLoadMaster.GetSceneToLoad(); //get scene to load if (!string.IsNullOrEmpty(sceneToLoad)) { LoadScene(sceneToLoad); } else { Debug.LogError("SaveLoadManager.LoadScene: scene name is empty"); } }
public void SaveGame(bool upgrades) { if (!upgrades) { SaveLoadMaster.SaveProgress(currentLevel, masterMoney); } else { Upgrades ups = this.GetComponent <Upgrades>(); SaveLoadMaster.SaveProgress(currentLevel, masterMoney, new int[3] { ups.aimSpeedLVL, ups.fireSpeedLVL, ups.pullPowerLVL }, new bool[6] { ups.Hooksize, ups.scannerUpgrade, ups.aimUpgrade, ups.BackGrab, ups.Destroyer, ups.autograb }); } }
public void LoadGameData() { SaveLoadMaster.LoadPlayerData(); //load player data SaveLoadMaster.LoadGeneralData(); //load general data }
public bool IsLoadGameDataAvailable() { return(SaveLoadMaster.IsSaveDataAvailable()); }
public bool LoadOptions() { var instance = SaveLoadMaster.LoadOptionsData(); //load options (for start screen) return(instance != null); }
public void SaveOptions() { SaveLoadMaster.SaveOptionsData(); //save options data (on start screen) }