//---------------------------------------------------------------------------------------------------------------------- internal void Integrate(Action onComplete) { string dccToolName = GetDCCToolInFileNameV(); string dccPluginFileName = dccToolName + "_" + GetCurrentDCCPluginPlatform() + ".zip"; //Make sure the DCC plugin zip file exists first DCCPluginDownloader downloader = new DCCPluginDownloader(false,SAVED_PLUGINS_FOLDER, new string[] { dccPluginFileName } ); string dccDesc = m_dccToolInfo.GetDescription(); string progressBarInfo = "Installing plugin for " + dccDesc; EditorUtility.DisplayProgressBar("MeshSync", progressBarInfo,0); downloader.Execute((string pluginVersion, List<string> dccPluginLocalPaths) => { EditorUtility.DisplayProgressBar("MeshSync", progressBarInfo, 0.5f); bool dccConfigured = false; if (dccPluginLocalPaths.Count >0 && File.Exists(dccPluginLocalPaths[0])) { //Extract string localPluginPath = dccPluginLocalPaths[0]; string tempPath = FileUtil.GetUniqueTempPathInProject(); Directory.CreateDirectory(tempPath); ZipUtility.UncompressFromZip(localPluginPath, null, tempPath); dccConfigured = ConfigureDCCToolV(m_dccToolInfo, Path.GetFileNameWithoutExtension(localPluginPath),tempPath); //Cleanup FileUtility.DeleteFilesAndFolders(tempPath); } if (!dccConfigured) { HandleFailedIntegration("Failed in configuring DCC ", dccDesc); return; } DCCPluginInstallInfo installInfo = new DCCPluginInstallInfo(pluginVersion); string installInfoPath = DCCPluginInstallInfo.GetInstallInfoPath(m_dccToolInfo); string installInfoFolder = Path.GetDirectoryName(installInfoPath); if (null == installInfoPath || null == installInfoFolder) { HandleFailedIntegration($"Invalid path: {installInfoPath}",dccDesc); return; } //Write DCCPluginInstallInfo for the version Directory.CreateDirectory(installInfoFolder); try { FileUtility.SerializeToJson(installInfo, installInfoPath); } catch (Exception e) { HandleFailedIntegration(e.ToString(), dccDesc); return; } EditorUtility.ClearProgressBar(); FinalizeDCCConfigurationV(); onComplete(); }, () => { Debug.LogError("[MeshSync] Failed to download DCC Plugin for " + dccDesc); EditorUtility.ClearProgressBar(); }); }