diff --git a/Editor/PerBuildPlayerSettings/PerBuildPlayerSettings.cs b/Editor/PerBuildPlayerSettings/PerBuildPlayerSettings.cs index 7f5f159..44f25b4 100644 --- a/Editor/PerBuildPlayerSettings/PerBuildPlayerSettings.cs +++ b/Editor/PerBuildPlayerSettings/PerBuildPlayerSettings.cs @@ -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 PreloadedAssets = new List(); [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();