private void Awake() { cupgrade = GetComponent <Cupgrade>(); string jsonstring = PlayerPrefs.GetString("weaponsDiscovered"); WeaponsDiscoveredJSON weaponsDiscoveredJSON = JsonUtility.FromJson <WeaponsDiscoveredJSON>(jsonstring); weaponsDiscovered = weaponsDiscoveredJSON.list; PreviousTier(); }
private void Awake() { DontDestroyOnLoad(gameObject); Instance = this; Cursor.visible = false; crosshair.SetActive(true); string jsonstring = PlayerPrefs.GetString("weaponsDiscovered"); WeaponsDiscoveredJSON weaponsDiscoveredJSON = JsonUtility.FromJson <WeaponsDiscoveredJSON>(jsonstring); weaponsDiscovered = weaponsDiscoveredJSON.list; }
public void EndScreen() { UIManager.Instance.SetEndScreen(timer, roomCounter, killCounter, weaponsCounter, chestCounter, healthKitCounter); Time.timeScale = 0f; Cursor.visible = true; crosshair.SetActive(false); WeaponsDiscoveredJSON weaponsDiscoveredJSON = new WeaponsDiscoveredJSON { list = weaponsDiscovered }; string json = JsonUtility.ToJson(weaponsDiscoveredJSON); PlayerPrefs.SetString("weaponsDiscovered", json); PlayerPrefs.Save(); }
private void Awake() { string jsonstring = PlayerPrefs.GetString("weaponsDiscovered"); WeaponsDiscoveredJSON weaponsDiscoveredJSON = JsonUtility.FromJson <WeaponsDiscoveredJSON>(jsonstring); if (weaponsDiscoveredJSON == null) { WeaponsDiscoveredJSON weaponsDiscoveredJSONn = new WeaponsDiscoveredJSON { list = new List <string>() { "Pistol" } }; string json = JsonUtility.ToJson(weaponsDiscoveredJSONn); PlayerPrefs.SetString("weaponsDiscovered", json); PlayerPrefs.Save(); } }