public static bool HasNewVersion(string pluginName) { if (I2AboutWindow.PluginsData == null) { return(false); } for (int i = 0; i < I2AboutWindow.PluginsData.Plugins.Length; i++) { if (I2AboutWindow.PluginsData.Plugins[i].Name == pluginName) { string InstalledVersion; bool ShouldUpgrade, HasNewBeta, ShouldSkip; I2AboutWindow.GetShouldUpgrade(I2AboutWindow.PluginsData.Plugins[i], out InstalledVersion, out ShouldUpgrade, out HasNewBeta, out ShouldSkip); if (!ShouldUpgrade && !ShouldSkip && HasNewBeta && I2AboutWindow.bNotifyOfNewBetas) { ShouldUpgrade = true; } return(ShouldUpgrade); } } return(false); }
static void CheckIfAnyPluginNeedsUpgrading() { EditorApplication.update -= CheckIfAnyPluginNeedsUpgrading; for (int i = 0; i < I2AboutWindow.PluginsData.Plugins.Length; ++i) { string InstalledVersion = string.Empty; bool ShouldUpgrade = false; bool HasNewBeta = false; bool ShouldSkip = false; I2AboutWindow.GetShouldUpgrade(I2AboutWindow.PluginsData.Plugins[i], out InstalledVersion, out ShouldUpgrade, out HasNewBeta, out ShouldSkip); if (InstalledVersion == "none" || ShouldSkip) { continue; } if ((ShouldUpgrade && I2AboutWindow.bNotifyOfNewMainVersions) || (HasNewBeta && I2AboutWindow.bNotifyOfNewBetas)) { I2AboutWindow.DoShowScreen(); return; } } }