Commit da156d9
committed
Add a quick "custom" build command
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();
}
}
```1 parent 0febfad commit da156d9
3 files changed
+35
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3226 | 3226 | | |
3227 | 3227 | | |
3228 | 3228 | | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
3229 | 3235 | | |
3230 | 3236 | | |
3231 | 3237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2104 | 2104 | | |
2105 | 2105 | | |
2106 | 2106 | | |
2107 | | - | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
2108 | 2135 | | |
2109 | 2136 | | |
2110 | 2137 | | |
| |||
0 commit comments