Beispiel #1
0
 internal static void UpdateCheck(bool successEnabled = false)
 {
     if (!File.Exists(localVersionFilepath))
     {
         JSONHelpers.SerializeToFile(localVersionFilepath, new LerpedUpdater(), true);
     }
     if (!noConnection)
     {
         try
         {
             WWW www = new WWW("https://raw.githubusercontent.com/Lerp2Dev/Lerp2API/master/Lerp2API.version");
             wh = new WWWHandler();
             wh.Add(www);
             wh.Start <WWW>(false, (x) =>
             {
                 var updater = x.text.Deserialize <LerpedUpdater>();
                 if (updater.versionStr != curVersion)
                 {
                     WarnOutdated(updater.versionStr);
                 }
                 else
                 {
                     if (successEnabled)
                     {
                         Debug.Log("Lerp2API is up-to-date!");
                     }
                 }
             });
         }
         catch (Exception e)
         {
             Debug.LogError("Internet connection couldn't be detected, Updates are disabled!\nMaybe it can be another problem, check the log by clicking this message.\n" + e.Message + "\n" + e.StackTrace);
             noConnection = true;
         }
     }
     else
     {
         CheckForConnection();
     }
 }
 internal static void SaveCommands()
 {
     JSONHelpers.SerializeToFile(commandPath, myTarget.commandList);
     Debug.Log("Command file saved!");     //Better a dialog, not?
 }