| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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();
}
}
```
|
thanks ill check! question: |
Sorry, something went wrong.
|
i'm thinking that this could have a settings field, for your own custom script to use for Builds.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Expects a editor script with in the format of:
UnityLauncherProToolsCustom.BuildCustom, e.g.: