Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

BuildAnalysisUtility.OpenWindow

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void OpenWindow(GUID buildSessionGuid);

Parameters

Parameter Description
buildSessionGuid The build session GUID of the build to select, for example BuildSummary.buildSessionGuid or a GUID returned by BuildHistory.GetAllBuilds. Passing an empty GUID throws an ArgumentException.

Description

Opens the Build Analysis window and selects a build from the build history.

Use this method to show a build right after it completes, or after you add a build to the build history with Build.BuildHistory.RegisterExternalBuild.

If the build history contains no build with this GUID, the window still opens, keeps its current selection, and logs a warning to the Console.

using UnityEditor;
using UnityEditor.Build.Analysis;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class OpenBuildAnalysisWindowExample { [MenuItem("Example/Build Analysis/Build Player and Analyze")] static void BuildPlayerAndAnalyze() { var options = new BuildPlayerOptions { scenes = new[] { "Assets/Scenes/SampleScene.unity" }, locationPathName = "Builds/MyGame", target = EditorUserBuildSettings.activeBuildTarget, };

BuildReport report = BuildPipeline.BuildPlayer(options); Debug.Log($"Build finished with result: {report.summary.result}");

// Open the Build Analysis window with the new build selected. BuildAnalysisUtility.OpenWindow(report.summary.buildSessionGuid); } }