Skip to content
Open
Changes from all 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
21 changes: 21 additions & 0 deletions Editor/PerBuildPlayerSettings/PerBuildPlayerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,33 @@ namespace SuperUnityBuild.BuildActions
{
public class PerBuildPlayerSettings : BuildAction, IPreBuildPerPlatformAction, IPostBuildPerPlatformAction, IPreBuildPerPlatformActionCanConfigureEditor
{
[Header("Resolution")]
public FullScreenMode fullScreenMode;
public bool defaultIsNativeResolution;
public int defaultScreenWidth = 800;
public int defaultScreenHeight = 600;
public bool runInBackground;
[Header("Standalone Player Options")]
public bool resizableWindow;
public bool visibleInBackground = true;
public bool allowFullscreenSwitch;

[Header("Other Settings")]
[Tooltip("Preloaded assets to set for this build")] public List<Object> PreloadedAssets = new List<Object>();
[Tooltip("Whether or not to preserve existing preloaded assets")] public bool PreservePreloadedAssets = true;

public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildScriptingBackend scriptingBackend, BuildDistribution distribution, DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
{
// Set resolution & presentation config
PlayerSettings.fullScreenMode = fullScreenMode;
PlayerSettings.defaultIsNativeResolution = defaultIsNativeResolution;
PlayerSettings.defaultScreenHeight = defaultScreenHeight;
PlayerSettings.defaultScreenWidth = defaultScreenWidth;
PlayerSettings.runInBackground = runInBackground;
PlayerSettings.resizableWindow = resizableWindow;
PlayerSettings.allowFullscreenSwitch = allowFullscreenSwitch;
PlayerSettings.visibleInBackground = visibleInBackground;

// Set preloaded assets
Object[] preloadedAssets = PlayerSettings.GetPreloadedAssets();

Expand Down