public bool Load() { if (isLoaded) { return(false); } if (ES2.Exists(Tag("saveParams"))) { ES2Data info = ES2.LoadAll(Tag("saveParams")); saveParams = info.LoadDictionary <string, object>("saveParams"); isLoaded = true; return(true); } isLoaded = false; return(false); }
public void Load() { if (ES2.Exists(file)) { ES2Data es2data = ES2.LoadAll(file, settings); dict = es2data.LoadDictionary <string, object>(settings.tag); isLoaded = true; if (OnLoadSuccess != null) { OnLoadSuccess(); } } else { isLoaded = false; if (OnLoadError != null) { OnLoadError(); } } }
public static bool Load() { bool isFirstGame = true; if (ES2.Exists("GameInfo.txt?encrypt=true&password=fcde34ux6sj")) { isFirstGame = false; Debug.Log("~~~~Exists~~~~"); ES2Data info = ES2.LoadAll("GameInfo.txt?encrypt=true&password=fcde34ux6sj"); Debug.Log("~~~~topScore" + (info.TagExists("topScore")?" Exists~~~~":" None~~~~")); Debug.Log("~~~~theme" + (info.TagExists("theme")?" Exists~~~~":" None~~~~")); Debug.Log("~~~~tile" + (info.TagExists("tile")?" Exists~~~~":" None~~~~")); Debug.Log("~~~~background" + (info.TagExists("background")?" Exists~~~~":" None~~~~")); Debug.Log("~~~~unlocked" + (info.TagExists("unlocked")?" Exists~~~~":" None~~~~")); if (info.TagExists("currentLevel")) { currentLevel = info.Load <int> ("currentLevel"); } // else // currentLevel = Resources.LoadAll<LevelData>("LevelData")[0].backupID; if (info.TagExists("topScoreLevels")) { topScoreLevels = info.LoadDictionary <int, int> ("topScoreLevels"); } else { topScoreLevels = new Dictionary <int, int> (); } if (info.TagExists("topScore")) { topScore = info.Load <int> ("topScore"); } else { topScore = 0; } if (info.TagExists("theme")) { currentTheme = info.Load <string> ("theme"); } else { currentTheme = "original"; } if (info.TagExists("tile")) { currentTile = info.Load <int> ("tile"); } else { currentTile = 0; } if (info.TagExists("background")) { currentBackground = info.Load <int> ("background"); } else { currentBackground = 0; } if (info.TagExists("unlocked")) { unlocks = info.LoadList <string> ("unlocked"); } else { unlocks = new List <string> () { "original", "colorblind", "tile 1", "wallpaper 1", } }; } else { topScore = 0; currentTheme = "original"; currentTile = 0; currentBackground = 0; unlocks = new List <string> () { "original", "colorblind", "tile 1", "wallpaper 1", }; } return(isFirstGame); }