public static void Load()
 {
     try
     {
         if (_instance == null)
         {
             _instance = new KPrivacyPrefs();
         }
         string path = GetPath();
         if (File.Exists(path))
         {
             string readText = File.ReadAllText(path);
             _instance = YamlIO.Parse <KPrivacyPrefs>(readText, path, null, null);
             if (_instance == null)
             {
                 LogError("Exception while loading privacy prefs:" + path);
                 _instance = new KPrivacyPrefs();
             }
         }
     }
     catch (Exception ex)
     {
         LogError(ex.ToString());
     }
 }
Exemplo n.º 2
0
 private void RestoreLegacyMetricsSetting()
 {
     if (KPlayerPrefs.GetInt("ENABLE_METRICS", 1) == 0)
     {
         KPlayerPrefs.DeleteKey("ENABLE_METRICS");
         KPlayerPrefs.Save();
         KPrivacyPrefs.instance.disableDataCollection = true;
         KPrivacyPrefs.Save();
     }
 }