[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Make your Unity game great on all form factors\n\nIn today's competitive gaming market, it's more important than ever to reach as\nwide an audience as possible. By developing games for different form factors,\nsuch as phones, tablets, foldables, and desktop, you can tap into a larger pool\nof potential players and increase your chances of success.\n\nSupport screen resizability\n---------------------------\n\nTo support different form factors, your game must be resizable. Resizability\nenables your game to support device configurations such as portrait and\nlandscape orientation, multi-window mode, and folded and unfolded states\nof foldable devices.\n\nIf your game doesn't support all window size\nand orientation configurations, the platform letterboxes your game in\n[compatibility mode](/guide/topics/large-screens/large-screen-compatibility-mode) and, if necessary, prompts the player\nbefore changing to an unsupported configuration.\n**Figure 1.** Configuration compatibility dialog.\n\nFor more information see\n[Support large screen resizability](/games/develop/multiplatform/support-large-screen-resizability).\n\n### Multi-window mode\n\nYour browser doesn't support the video tag. **Figure 2.** Different UIs on desktop and foldable in tabletop posture.\n\n[Multi-window\nmode](/develop/ui/compose/layouts/adaptive/support-multi-window-mode) enables\nmultiple apps to share the same screen simultaneously. Apps can be side by side\nor one above the other (split-screen mode), one app in a small window overlaying\nother apps (picture-in-picture mode), or individual apps in separate movable,\nresizable windows (free-form mode).\n\nTo avoid getting into [compatibility mode](/guide/topics/large-screens/large-screen-compatibility-mode) when your game\nruns in multi-window mode, declare that your game is able to handle\nresizability by enabling the **Resizable Window** option in the\n[Unity build settings](https://docs.unity3d.com/Manual/class-PlayerSettingsAndroid.html).\n**Figure 3.** Unity's Resolution and Presentation settings for Android.\n\n### Display cutouts\n\nA [*display cutout*](/guide/topics/display-cutout) is an area on some devices\nthat extends into the display surface. Cutouts allow for an edge-to-edge\nexperience while providing space for important sensors on the front of the\ndevice.\n**Figure 4.** Display cutout.\n\nTo bring an edge-to-edge experience to your game, configure the game to be\nsafe-frame aware. Query the Unity [safeArea API](https://docs.unity3d.com/ScriptReference/Screen-safeArea.html) to get\nthe safe area of the screen in pixels and adjust your game UI and UX\naccordingly, especially for the elements that users can interact with.\n\n### Foldable postures\n\nFoldable devices can be in various folded states, such as\n[`FLAT`](/reference/kotlin/androidx/window/layout/FoldingFeature.State#FLAT())\n(fully open) or\n[`HALF_OPENED`](/reference/kotlin/androidx/window/layout/FoldingFeature.State#HALF_OPENED())\n(somewhere between fully open and completely closed). When a device is in the\n`HALF_OPENED` state, two postures are possible, depending on the orientation of\nthe fold: tabletop posture (horizontal fold) and book posture (vertical fold).\nUse tabletop posture to increase player immersion and engagement.\n**Figure 5.** Game in tabletop posture with main view on vertical portion of display, controls on horizontal portion.\n\nTo implement tabletop posture,\n[extend the default Unity activity](https://docs.unity3d.com/2022.1/Documentation/Manual/AndroidUnityPlayerActivity.html) and then\nuse the Jetpack WindowManager layout library to\n[make your game fold aware](/develop/ui/compose/layouts/adaptive/foldables/make-your-app-fold-aware).\n\nUnity sample project\n--------------------\n\nThe Unity sample project is based on the Unity 2D demonstration project\n[Lost Crypt](https://assetstore.unity.com/packages/essentials/tutorial-projects/lost-crypt-2d-sample-project-158673). The sample project demonstrates how to\nsupport large screen resizability in Unity. Large screen and foldable device\nsupport requires a number of changes to the Unity build options, as well as\nconsiderations in the layout of your camera and UI canvases.\n\nThe sample project is available to [download now](https://goo.gle/unity_ls_sample).\nThe project contains four different scenes:\n\n- **Original:** Support for basic resizable feature\n- **Anchoring:** Same as \"Original\" scene, but adapts to various aspect ratios and avoids the display cutout\n- **HingeAware:** Same as \"Anchoring\" scene, but supports tabletop posture\n- **Mainmenu:** Starting scene, allows navigation to the other scenes and fully supports all device orientations, fold, unfold, and tabletop posture\n\nWhen building for Android, select all the scenes and set the \"Mainmenu\" scene\nas the starting scene.\n**Figure 6.** \"Mainmenu\" scene lets you to navigate to the other scenes, in tabletop posture.\n\n### Begin with resizable window support\n\nImplement support for various displays sizes and aspect ratios in your\nAndroid large screen application to ensure your game or application displays\ncorrectly on different devices. Enable your game to resize and change\naspect ratio by setting the **Resizable Window** property in the Unity build\nsettings (see the [\"Multi-window mode\"](#multi-window_mode) section). Adjust\nthe camera and canvas aspect ratio to better fit different\nscreens. View project settings in the **Build Settings** and in the\n`Plugins/Android/AndroidManifest.xml` file. Experience the full screen\nresizable feature in the project's \"Original\" scene.\n**Figure 7.** \"Original\" scene supports Resizable Window feature.\n\n### Go full-screen immersive while handling display cutouts\n\nEnable your game to use the entire screen to make gameplay\nimmersive for an enhanced user experience. Update your game UI anchoring and\ncamera settings to automatically adjust to the\nscreen size. This allows UI elements to maintain their positions relative to the\nscreen size.\n\nThe \"Anchoring\" scene uses the\n`CameraAspectLock` script to respond to device configuration changes by\nmeans of an [extended activity](https://docs.unity3d.com/2022.1/Documentation/Manual/AndroidUnityPlayerActivity.html) (see\n`Assets/Plugins/Android/LargeScreenPlayableActivity.java`). Unity's\n[safeArea API](https://docs.unity3d.com/ScriptReference/Screen-safeArea.html) is demonstrated in the `SafeZoneAPI`\nscript, which binds to the `SafeZone` object inside the \"Anchoring\" scene.\n**Figure 8.** \"Anchoring\" scene with display cutout.\n\n### Optimize for foldable devices\n\nThe last scene of the Unity sample project, \"HingeAware\", contains a\n`ConfigurationManager` object that responds to the different folding\nstates of the target device through [Jetpack library APIs](/develop/ui/compose/layouts/adaptive/foldables/make-your-app-fold-aware) and an\n[extended activity](https://docs.unity3d.com/2022.1/Documentation/Manual/AndroidUnityPlayerActivity.html) (see\n`Assets/Plugins/Android/LargeScreenPlayableActivity.java`). The scene uses\nthe `PanelOnFold` script to control the UI based on the fold status\nof the device, for example, showing the bottom controller panel when the\ndevice is in tabletop posture and adjusting the camera.\n**Figure 9.** \"HingeAware\" scene supports tabletop posture."]]