示例#1
0
 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 });
         }
     }
 }
示例#2
0
 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);
 }
示例#3
0
 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
     });
 }
示例#4
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
    }
示例#5
0
    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");
        }
    }
示例#6
0
 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
         });
     }
 }
示例#7
0
 public void LoadGameData()
 {
     SaveLoadMaster.LoadPlayerData();  //load player data
     SaveLoadMaster.LoadGeneralData(); //load general data
 }
示例#8
0
 public bool IsLoadGameDataAvailable()
 {
     return(SaveLoadMaster.IsSaveDataAvailable());
 }
示例#9
0
    public bool LoadOptions()
    {
        var instance = SaveLoadMaster.LoadOptionsData(); //load options (for start screen)

        return(instance != null);
    }
示例#10
0
 public void SaveOptions()
 {
     SaveLoadMaster.SaveOptionsData(); //save options data (on start screen)
 }