コード例 #1
0
 internal static void Update()
 {
     try
     {
         PlayerPrefs.SetString("EnabledGadgets", enabledGadgets.Select(x => x.Key + ":" + x.Value).Aggregate(new StringBuilder(), (a, b) => { if (a.Length > 0)
                                                                                                                                              {
                                                                                                                                                  a.Append(",");
                                                                                                                                              }
                                                                                                                                              a.Append(b); return(a); }).ToString());
         foreach (Registry reg in GameRegistry.ListAllRegistries())
         {
             PlayerPrefs.SetString("Reserved" + reg.GetRegistryName() + "IDs", reg.reservedIDs.Select(x => x.Key + "=" + x.Value).Aggregate(new StringBuilder(), (a, b) => { if (a.Length > 0)
                                                                                                                                                                             {
                                                                                                                                                                                 a.Append(",");
                                                                                                                                                                             }
                                                                                                                                                                             a.Append(b); return(a); }).ToString());
         }
         PlayerPrefs.Flush();
     }
     catch (Exception e)
     {
         GadgetCore.CoreLogger.LogError("Error updating config: " + e.Message + "(" + e.InnerException?.Message + ")");
     }
 }