Beispiel #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);
    }
Beispiel #2
0
 public static int[] GetIntArrayValue(string key, int[] defaultValue = null)
 {
     return(data.GetIntArrayValue(key, defaultValue));
 }