| Parameter | Description |
|---|---|
| buildSessionGuid | The unique session GUID of the build to search within. |
| filename | The name of the file to locate, for example contentlayout.json. |
| filePath | When this method returns, contains the absolute path to the file if it exists. |
bool
true if the build is tracked and the file exists on disk; otherwise false.
Attempts to get the path to a specific file within a build's metadata folder.
using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; using UnityEngine;
public class GetTepFileExample { [MenuItem("Example/BuildHistory/Get Build Performance Profiling File Path")] static public void GetTraceEventFilePath() { // Example showing how to get the path to the trace event file // recording build performance profiling information about the latest build. if (!BuildHistory.TryGetLatestBuild(out GUID latestBuildGuid)) { Debug.Log("No builds found in build history."); return; }
// Check if the latest build wrote a profiler file string tepFilename = "BuildContentTEP.json"; if (BuildHistory.TryGetFilePath(latestBuildGuid, tepFilename, out string tepFilePath)) { Debug.Log($"Found Trace Event file for latest build: {tepFilePath}."); } else { // The file might not exist if the latest build wasn't a ContentDirectory build, // or if Build Performance Profiling is not enabled. Debug.Log($"Trace Event file '{tepFilename}' not found for the latest build."); } } }