Example #1
0
    public static bool LoadGameDataXML()
    {
        game_data = new DictionaryFile();
        game_data.LoadFromFile(Path.Combine(DataStorage.Instance.GetPath(), gameData));

        if (!game_data.IsSuccessfullyLoaded)
        {
            Debug.LogErrorFormat("GameData: recreating corrupted {0}.", gameData);
            if (File.Exists(Path.Combine(DataStorage.Instance.GetPath(), gameData)))
            {
                File.Delete(Path.Combine(DataStorage.Instance.GetPath(), gameData));
            }
            if (File.Exists(Path.Combine(DataStorage.Instance.GetPath(), convicted)))
            {
                File.Delete(Path.Combine(DataStorage.Instance.GetPath(), convicted));
            }
        }
        else
        {
            GameData.current = new GameData();
            GameData.current.SetStringValues(game_data.GetArrayValue("GameData.current"));
            GameData.current.SetAllCharactersCompleted(game_data.GetIntArrayValue("CHARACTER_COMPLETED"));
        }

        return(game_data.IsSuccessfullyLoaded);
    }
Example #2
0
 public static string[] GetArrayValue(string key, string[] defaultValue = null)
 {
     return(data.GetArrayValue(key, defaultValue));
 }