resizeableActivity
Indicates whether your Android application is resizable.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Property
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public static bool resizeableActivity { get; set; }
Remarks
By default the Android application is resizable. Disable this option to make the application non-resizable.
Note: If you enable this option, your application will continue to run when it loses focus but is visible on screen. If the application is minimized or no longer visible the Android Player will pause.
Examples
using UnityEngine;using UnityEditor;using UnityEditor.Build;public class ResizeableActivitySample : MonoBehaviour{ [MenuItem("Build/ResizeableActivity Sample")] public static void BuildResizeableActivitySample() { PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP); PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64; //Set resizeableActivity to true PlayerSettings.Android.resizeableActivity = true; BuildPlayerOptions options = new BuildPlayerOptions(); options.scenes = new[] { "Assets/Scenes/SampleScene.unity" }; options.locationPathName = "Build/AndroidBuild.apk"; options.target = BuildTarget.Android; options.targetGroup = BuildTargetGroup.Android; BuildPipeline.BuildPlayer(options); }}