Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created March 25, 2024 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baba-s/e65d68f21c6b31ce8aebdf83c194b078 to your computer and use it in GitHub Desktop.
Save baba-s/e65d68f21c6b31ce8aebdf83c194b078 to your computer and use it in GitHub Desktop.
using System.Linq;
using UnityEditor;
[InitializeOnLoad]
public static class Example
{
static Example()
{
BuildPlayerWindow.RegisterGetBuildPlayerOptionsHandler( OnGetBuildPlayerOptions );
}
private static BuildPlayerOptions OnGetBuildPlayerOptions( BuildPlayerOptions buildPlayerOptions )
{
buildPlayerOptions.scenes = EditorBuildSettings.scenes.Select( x => x.path ).ToArray();
buildPlayerOptions.locationPathName = "app.apk";
buildPlayerOptions.targetGroup = BuildTargetGroup.Android;
buildPlayerOptions.target = BuildTarget.Android;
return buildPlayerOptions;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment