/* * Constructor */ public AdvancedSettingsRenderer(AdvancedSettings advancedSettings) { m_advancedSettings = advancedSettings; if (string.IsNullOrEmpty(advancedSettings.customPath)) { setDefaultCustomPath(); } }
public ConfigurationSceneRenderer(AdvancedSettings advancedSettings) { m_advancedSettings = advancedSettings; }
/* * Draw the summary of things that are going to be build for this platform */ public void drawBuildSummary(AdvancedSettings advancedSettings, Configuration configuration, string bundleVersion) { PlatformProperties platformProperties = configuration.platform.getPlatformProperties(); if (!platformProperties.isSupported()) { return; } GUIUtils.DrawTwoColumns("Release type", configuration.releaseType.name); GUIUtils.DrawTwoColumns("Product name", configuration.releaseType.productName); GUIUtils.DrawTwoColumns("Bundle identifier", configuration.releaseType.bundleIdentifier); GUIUtils.DrawTwoColumns("Bundle version", bundleVersion); GUIUtils.DrawTwoColumns("Platform", platformProperties.name); if (!configuration.distributionPlatform.name.Equals("Default")) { GUIUtils.DrawTwoColumns("Distribution Platform", configuration.distributionPlatform.name); } if (platformProperties.isUsingPlatformArchitecture()) { GUIUtils.DrawTwoColumns("Architecture", configuration.platformArchitecture.name); } if (platformProperties.isUsingTextureCompression()) { GUIUtils.DrawTwoColumns("Texture Compression", configuration.textureProperties.name); } if (m_platformAdditionalRenderer != null) { m_platformAdditionalRenderer.drawAdditionalBuildSummary(configuration.platformArchitecture, configuration.textureCompression, bundleVersion); } EditorGUILayout.LabelField(configuration.getBuildPath(advancedSettings, DateTime.Now, bundleVersion)); }
private bool performBuild(Configuration configuration, string buildDestinationPath, string fileName, AdvancedSettings advancedSettings) { /* * Create the build folder if it does not exist */ string buildDirectory = Application.dataPath.Replace("Assets", "Builds"); Directory.CreateDirectory(buildDirectory); /* * Create the subfolder that will contain the final build */ string finalBuildPath = buildDirectory + "/" + buildDestinationPath + fileName; Directory.CreateDirectory(finalBuildPath.Substring(0, finalBuildPath.LastIndexOf("/"))); /* * Before building, we refresh all assets */ GUIUtils.RefreshAssets(); /* * Start the build through Unity process */ EditorUtility.DisplayProgressBar("Advanced Builder", "Building " + finalBuildPath.Replace("/", " - ").Replace(buildDirectory, string.Empty) + "...", 0.5f); EditorUserBuildSettings.SwitchActiveBuildTarget(configuration.platformArchitecture.buildTarget); // Set Build Options BuildOptions buildOptions = BuildOptions.None; if (configuration.openBuildFolder) { buildOptions |= BuildOptions.ShowBuiltPlayer; } if (configuration.isDevelopmentBuild) { buildOptions |= BuildOptions.Development; } if (configuration.shouldAutoconnectProfiler) { buildOptions |= BuildOptions.ConnectWithProfiler; } if (configuration.shouldAutoRunPlayer) { buildOptions |= BuildOptions.AutoRunPlayer; } if (configuration.allowDebugging) { buildOptions |= BuildOptions.AllowDebugging; } if (configuration.appendProject) { if (Directory.Exists(finalBuildPath)) { buildOptions |= BuildOptions.AcceptExternalModificationsToPlayer; } } if (advancedSettings.useSymlinkLibraries) { buildOptions |= BuildOptions.SymlinkLibraries; } // Build Player string error = BuildPipeline.BuildPlayer(Utils.GetActiveScenePathArray(), finalBuildPath, configuration.platformArchitecture.buildTarget, buildOptions); if (error != string.Empty) { Debug.LogError("Error:" + error); EditorUtility.ClearProgressBar(); return false; } EditorUtility.DisplayProgressBar("Advanced Builder", "Doing post build stuff...", 1.0f); /* * After building, we refresh all assets */ GUIUtils.RefreshAssets(); EditorUtility.ClearProgressBar(); return true; }