Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     GameStates.SetLevel();
     GameStates.LevelInit();
     GameStates.DataStorageInit();
     DataStorage.LoadData();
 }
Beispiel #2
0
 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]);
         }
     }
 }
Beispiel #3
0
 public static void EraseData()
 {
     GameStates.DataStorageInit();
     SaveData();
     LoadData();
 }