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
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsUnityLauncherPro/MainWindow.xaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -227,6 +227,7 @@
<MenuItem Header="Build">
<MenuItem x:Name="menuBatchBuildAndroid" Header="Android" Click="MenuBatchBuildAndroid_Click"/>
<MenuItem x:Name="menuBatchBuildIOS" Header="IOS" Click="MenuBatchBuildIOS_Click"/>
<MenuItem x:Name="menuBatchBuildCustom" Header="Custom" Click="MenuBatchBuildCustom_Click"/>
</MenuItem>
<MenuItem Header="Tools">
<MenuItem x:Name="menuExcludeFromDefender" Header="Exclude Path From Defender" Click="menuExcludeFromDefender_Click"/>
Expand Down
6 changes: 6 additions & 0 deletionsUnityLauncherPro/MainWindow.xaml.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3226,6 +3226,12 @@ private void MenuBatchBuildIOS_Click(object sender, RoutedEventArgs e)
Tools.BuildProject(proj, Platform.iOS);
}

private void MenuBatchBuildCustom_Click(object sender, RoutedEventArgs e)
{
var proj = GetSelectedProject();
Tools.BuildProjectCustom(proj);
}

private void ChkCheckPlasticBranch_Checked(object sender, RoutedEventArgs e)
{
if (this.IsActive == false) return; // dont run code on window init
Expand Down
29 changes: 28 additions & 1 deletionUnityLauncherPro/Tools.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2104,7 +2104,34 @@ static string[] GetScenes()

}

// runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
public static void BuildProjectCustom(Project proj)
{
Console.WriteLine("Building " + proj.Title + " (custom)");
SetStatus("Build process started: " + DateTime.Now.ToString("HH:mm:ss"));

// get selected project unity exe path
var unityExePath = Tools.GetUnityExePath(proj.Version);
if (unityExePath == null) return;

// create commandline string for building and launch it
//var buildcmd = $"\"{unityExePath}\" -quit -batchmode -nographics -projectPath \"{proj.Path}\" -executeMethod \"Builder.BuildAndroid\" -buildTarget android -logFile -";
// TODO test without nographics : https://forum.unity.com/threads/batch-build-one-scene-is-black-works-in-normal-file-build.1282823/#post-9456524
var buildParams = $" -quit -batchmode -nographics -projectPath \"{proj.Path}\" -executeMethod \"UnityLauncherProToolsCustom.BuildCustom\"";
Console.WriteLine("buildcmd= " + buildParams);

// launch build
var proc = Tools.LaunchExe(unityExePath, buildParams);

// wait for process exit then open output folder
proc.Exited += (o, i) =>
{
SetStatus("Build process finished: " + DateTime.Now.ToString("HH:mm:ss"));
// TODO set color based on results
SetBuildStatus(Colors.Green);
};
}

// runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
public static void LaunchWebGL(Project proj, string relativeFolder)
{
var projPath = proj?.Path.Replace('/', '\\');
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp