Пример #1
0
        static Autorun()
        {
            AndroidPlugin.SetEnabled(LunarConsoleConfig.consoleEnabled);

            Updater.TryCheckForUpdates();
            LunarConsoleEditorAnalytics.TrackPluginVersionUpdate();
        }
Пример #2
0
        static Autorun()
        {
            AndroidPlugin.SetEnabled(LunarConsoleConfig.consoleEnabled);
            CleanLegacyFiles(); // automatically fix old installations

            Updater.TryCheckForUpdates();
            LunarConsoleEditorAnalytics.TrackPluginVersionUpdate();
        }
Пример #3
0
        static Autorun()
        {
            Updater.TryCheckForUpdates();

            #if UNITY_ANDROID
            AndroidPlugin.UpdateFiles();
            #endif

            LunarConsoleEditorAnalytics.TrackPluginVersionUpdate();
        }
Пример #4
0
        public static void CheckForUpdates(bool silent = true)
        {
            LunarConsoleHttpClient downloader = new LunarConsoleHttpClient(LunarConsoleConfig.fullVersion ? Constants.UpdateJsonURLFull : Constants.UpdateJsonURLFree);

            downloader.DownloadString(delegate(string response, Exception error)
            {
                if (error != null)
                {
                    Log.e(error, "Can't get updater info");
                    if (!silent)
                    {
                        Utils.ShowDialog(kMessageBoxTitle, "Update info is not available.\n\nTry again later.", "OK");
                    }
                    return;
                }

                UpdateInfo info;
                if (response != null && TryParseUpdateInfo(response, out info))
                {
                    if (IsShouldSkipVersion(info.version))
                    {
                        Log.d("User decided to skip version {0}", info.version);
                        return;
                    }

                    if (PluginVersionChecker.IsNewerVersion(info.version))
                    {
                        StringBuilder message = new StringBuilder();
                        message.AppendFormat("A new version {0} is available!\n\n", info.version);
                        if (info.message != null && info.message.Length > 0)
                        {
                            message.Append(info.message);
                            message.AppendLine();
                        }

                        Utils.ShowDialog(kMessageBoxTitle, message.ToString(),
                                         new DialogButton("Details...", delegate(string obj)
                        {
                            Application.OpenURL(info.url);
                            LunarConsoleEditorAnalytics.TrackEvent("Version", "updater_details");
                        }),
                                         new DialogButton("Remind me later", delegate(string obj) {
                            LunarConsoleEditorAnalytics.TrackEvent("Version", "updater_later");
                        }),
                                         new DialogButton("Skip this version", delegate(string obj)
                        {
                            SetShouldSkipVersion(info.version);
                            LunarConsoleEditorAnalytics.TrackEvent("Version", "updater_skip");
                        })
                                         );
                    }
                    else
                    {
                        if (!silent)
                        {
                            Utils.ShowMessageDialog(kMessageBoxTitle, "Everything is up to date");
                        }
                        Debug.Log("Everything is up to date");
                    }
                }
                else
                {
                    Log.e("Unable to parse response: '{0}'", response);
                    if (!silent)
                    {
                        Utils.ShowDialog(kMessageBoxTitle, "Update info is not available.\n\nTry again later.", "OK");
                    }
                }
            });
        }
Пример #5
0
 static void CheckForUpdates()
 {
     LunarConsoleEditorAnalytics.TrackEvent("Version", "updater_check");
     Updater.CheckForUpdates(false);
 }