You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expects a editor script with in the format of:
```cs
using System.Diagnostics;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
public static class UnityLauncherProToolsCustom
{
[MenuItem("Tools/Build custom")]
public static void BuildCustom()
{
var settings = new BuildPlayerOptions();
settings.scenes = GetScenes();
settings.locationPathName = Path.GetFullPath(Path.Combine(Application.dataPath, "..", "..", "..", "Build", PlayerSettings.productName + ".exe"));
settings.target = EditorUserBuildSettings.activeBuildTarget;
var report = BuildPipeline.BuildPlayer(settings);
if (report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
Process.Start(Path.GetDirectoryName(settings.locationPathName));
}
static string[] GetScenes()
{
return EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(scene => scene.path).ToArray();
}
}
```
0 commit comments