GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Add a quick "custom" build command by krisrok · Pull Request #199 · unitycoder/UnityLauncherPro Conversation
Contributor
Expects a editor script with in the format of: UnityLauncherProToolsCustom.BuildCustom, e.g.: 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(); } }
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsExpects 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();
}
}
```
Owner
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
i'm thinking that this could have a settings field, for your own custom script to use for Builds.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.