GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a quick "custom" build command by krisrok · Pull Request #199 · unitycoder/UnityLauncherPro

Conversation

@krisrok

@krisrok krisrok commented Aug 8, 2025

Copy link
Copy Markdown
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 reactions
@krisrok
Add a quick "custom" build command
da156d9
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();
    }
}
```
@unitycoder

unitycoder commented Aug 8, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unitycoder

unitycoder commented Aug 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unitycoder
unitycoder merged commit f90e8ac into unitycoder:master Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@krisrok @unitycoder
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.