Example #1
0
 void LoadInvetory()
 {
     if (SaveLoadSystem.SaveExists("Inventory"))
     {
         GiveItems(SaveLoadSystem.Load <List <Item> >("Inventory"));
     }
 }
 void Load()
 {
     if (SaveLoadSystem.SaveExists("CollectedItems"))
     {
         CollectedItems = SaveLoadSystem.Load <HashSet <string> >("CollectedItems");
     }
 }
Example #3
0
 public void LoadCharacterStats()
 {
     if (SaveLoadSystem.SaveExists("PlayerStats"))
     {
         SaveCharacterStats stats = SaveLoadSystem.Load <SaveCharacterStats>("PlayerStats");
         this.Health  = stats.Health;
         this.Stamina = stats.Stamina;
     }
 }
    public void NewGame(int index)
    {
        if (SaveLoadSystem.SaveExists("Inventory") || SaveLoadSystem.SaveExists("CollectedItems"))
        {
            SaveLoadSystem.DeleteAllSavedFiles();
        }
        PlayerPrefs.DeleteAll();

        loadingScreen.SetActive(true);
        mainMenuPanel.SetActive(false);
        loadingDelay = true;
        sceneIndex   = index;
        continueGame.SetActive(false);
        backMusic.volume = 0f;
    }
 private void Start()
 {
     backMusic.volume = 0.5f;
     if (SaveLoadSystem.SaveExists("Inventory") || SaveLoadSystem.SaveExists("CollectedItems"))
     {
         continueGame.SetActive(true);
         EventSystem.current.SetSelectedGameObject(continueGame);
     }
     else
     {
         continueGame.SetActive(false);
         newGame.GetComponent <Button>().Select();
         EventSystem.current.SetSelectedGameObject(newGame);
     }
     Time.timeScale = 1;
 }