public void ReloadAllLevel() { levels.LoadLevelsName(); foreach (string levelName in levels.Levels) { #if UNITY_STANDALONE_WIN StreamReader sr = new StreamReader(Application.dataPath + "/Levels/" + levelName + ".txt"); #endif #if UNITY_ANDROID StreamReader sr = new StreamReader(Application.persistentDataPath + "/Levels/" + levelName + ".txt"); #endif string json = sr.ReadToEnd(); if (!LevelDic.ContainsKey(levelName)) { LevelDic[levelName] = JsonUtility.FromJson <Level>(json); } sr.Close(); } }