// Jimmy Vegas Unity Tutorial // These scripts will load your game using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class MainMenuOptions : MonoBehaviour { public static bool isLoading = false; public void NewGame() { SceneManager.LoadScene(1); } public void LoadGame() { isLoading = true; SceneManager.LoadScene(1); } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameLoader : MonoBehaviour { public int savedCookies; public int savedCash; public int savedBakers; public int savedShops; public int savedValue; void Start () { if (MainMenuOptions.isLoading == true) { savedCookies = PlayerPrefs.GetInt("SavedCookies"); GlobalCookies.CookieCount = savedCookies; savedCash = PlayerPrefs.GetInt("SavedCash"); GlobalCash.CashCount = savedCash; savedBakers = PlayerPrefs.GetInt("SavedBakers"); GlobalBaker.bakePerSec = savedBakers; savedShops = PlayerPrefs.GetInt("SavedShops"); GlobalShop.numberOfShops = savedShops; savedValue = PlayerPrefs.GetInt("SaveValue"); SaveGame.saveValue = savedValue; } } }