// Start is called before the first frame update void Start() { GameStates.SetLevel(); GameStates.LevelInit(); GameStates.DataStorageInit(); DataStorage.LoadData(); }
public static void LoadData() { GameStates.DataStorageInit(); if (File.Exists(Application.persistentDataPath + "/data.json") == true) { string[] data = File.ReadAllLines(Application.persistentDataPath + "/data.json"); for (int i = 0; i < GameStates.maxLevel; i++) { passedLevels[i] = JsonUtility.FromJson <LevelData>(data[i]); } } }
public static void EraseData() { GameStates.DataStorageInit(); SaveData(); LoadData(); }