Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a quick "custom" build command#199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
unitycoder merged 1 commit intounitycoder:masterfromkrisrok:feature/build_custom
Aug 30, 2025

Conversation

@krisrok
Copy link
Contributor

Expects a editor script with in the format of:

UnityLauncherProToolsCustom.BuildCustom, e.g.:

usingSystem.Diagnostics;usingSystem.IO;usingSystem.Linq;usingUnityEditor;usingUnityEngine;publicstaticclassUnityLauncherProToolsCustom{[MenuItem("Tools/Build custom")]publicstaticvoidBuildCustom(){varsettings=newBuildPlayerOptions();settings.scenes=GetScenes();settings.locationPathName=Path.GetFullPath(Path.Combine(Application.dataPath,"..","..","..","Build",PlayerSettings.productName+".exe"));settings.target=EditorUserBuildSettings.activeBuildTarget;varreport=BuildPipeline.BuildPlayer(settings);if(report.summary.result==UnityEditor.Build.Reporting.BuildResult.Succeeded)Process.Start(Path.GetDirectoryName(settings.locationPathName));}staticstring[]GetScenes(){returnEditorBuildSettings.scenes.Where(scene=>scene.enabled).Select(scene=>scene.path).ToArray();}}

Expects a editor script with in the format of:```csusing 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();    }}```
@unitycoder
Copy link
Owner

thanks ill check!

question:
so i guess there is no easy way to check if that custom build script is available?
unless its in some fixed path Assets/Editor/UnityLauncherProToolsCustom.cs,
then could disable that menu item, if not available.

@unitycoder
Copy link
Owner

unitycoder commentedAug 24, 2025
edited
Loading

i'm thinking that this could have a settings field, for your own custom script to use for Builds.
And if the field is empty or no checkbox enabled, then it uses the current builtin one.

  • although then you cannot have different script per project.. so probably cannot do that.. ok skip this comment.

like init script:
image

@unitycoderunitycoder merged commitf90e8ac intounitycoder:masterAug 30, 2025
1 check passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@krisrok@unitycoder

[8]ページ先頭

©2009-2025 Movatter.jp