private IEnumerator UpdateVersion() { GoogleAnalyticsHelper.LogEvent("Install", version_, 0); progress_ = 0.05f; state_ = "Upgrading project"; yield return(null); Upgrade(localVersion_); progress_ = 0.10f; state_ = "Cleaning resources"; yield return(null); Noesis.BuildToolKernel.BuildBegin(); Noesis.BuildToolKernel.Clean(); progress_ = 0.20f; string[] activePlatforms = NoesisSettings.ActivePlatforms; foreach (var platform in activePlatforms) { state_ = "Regenerating " + platform + " resources"; yield return(null); using (var builder = new Noesis.BuildToolKernel(platform)) { builder.BuildAll(); } progress_ = 0.20f + 0.60f * (1 + ArrayUtility.IndexOf(activePlatforms, platform)) / activePlatforms.Length; } state_ = "Updating version"; yield return(null); NoesisVersion.SetCached(version_); progress_ = 0.85f; state_ = "Extracting documentation...\n"; yield return(null); ExtractDocumentation(); progress_ = 0.99f; state_ = "Opening Welcome Window...\n"; yield return(null); EditorWindow.GetWindow(typeof(NoesisWelcome), true, "Welcome to NoesisGUI!"); progress_ = 1.0f; Debug.Log("NoesisGUI v" + version_ + " successfully installed"); }
private IEnumerator UpdateVersion() { GoogleAnalyticsHelper.LogEvent("Install", version_, 0); progress_ = 0.10f; state_ = "Upgrading project"; yield return(null); Upgrade(localVersion_); progress_ = 0.20f; state_ = "Updating version"; yield return(null); NoesisVersion.SetCached(version_); progress_ = 0.35f; state_ = "Creating default settings"; yield return(null); NoesisSettings.Get(); progress_ = 0.40f; state_ = "Extracting documentation...\n"; yield return(null); ExtractDocumentation(); progress_ = 0.60f; state_ = "Importing assets...\n"; yield return(null); NoesisPostprocessor.ImportAllAssets(); progress_ = 0.90f; state_ = "Opening Welcome Window...\n"; yield return(null); EditorWindow.GetWindow(typeof(NoesisWelcome), true, "Welcome to NoesisGUI!"); progress_ = 1.0f; Debug.Log("NoesisGUI v" + version_ + " successfully installed"); }
private static void CheckVersion() { EditorApplication.update -= CheckVersion; if (!UnityEditorInternal.InternalEditorUtility.inBatchMode) { string localVersion = NoesisVersion.GetCached(); string version = NoesisVersion.Get(); // Remove the file that indicates Noesis package is being installed AssetDatabase.DeleteAsset("Assets/NoesisGUI/Plugins/Editor/installing"); // Detect if /Library is being recreated string noesisFile = Path.Combine(Application.dataPath, "../Library/noesis"); bool libraryFolderRecreated = !File.Exists(noesisFile); if (libraryFolderRecreated) { File.Create(noesisFile).Dispose(); } if (localVersion != version && version != "0.0.0") { if (NoesisVersion.RestartNeeded()) { Debug.LogWarning("Please restart Unity to reload NoesisGUI native plugin! " + "If error persists remove 'Assets/NoesisGUI/Plugins' and reimport again."); return; } string title; if (localVersion != "") { title = "Upgrading NoesisGUI " + localVersion + " -> " + version; } else { title = "Installing NoesisGUI " + version; } EditorUtility.DisplayProgressBar(title, "", 0.0f); GoogleAnalyticsHelper.LogEvent("Install", version, 0); EditorUtility.DisplayProgressBar(title, "Upgrading project", 0.10f); Upgrade(localVersion); EditorUtility.DisplayProgressBar(title, "Updating version", 0.20f); NoesisVersion.SetCached(version); EditorUtility.DisplayProgressBar(title, "Creating default settings", 0.35f); NoesisSettings.Get(); EditorUtility.DisplayProgressBar(title, "Extracting documentation...", 0.40f); ExtractTar("NoesisGUI/Doc.tar", "/../NoesisDoc", "/../NoesisDoc"); EditorUtility.DisplayProgressBar(title, "Extracting blend samples...", 0.55f); ExtractTar("NoesisGUI/Samples/Samples-blend.tar", "/..", "/../Blend"); NoesisPostprocessor.ImportAllAssets((progress, asset) => { EditorUtility.DisplayProgressBar(title, asset, 0.60f + progress * 0.40f); }); EditorApplication.update += ShowWelcomeWindow; EditorUtility.ClearProgressBar(); Debug.Log("NoesisGUI v" + version + " successfully installed"); } else if (libraryFolderRecreated) { NoesisPostprocessor.ImportAllAssets(); } } }