Version: 2022.1
Unity Editor command line arguments
バッチモードとビルトインコルーチンの互換性

Unity Standalone Player command line arguments

You can launch Unity Players from the command line and pass in arguments to change how the Player executes. These arguments work on any standalone platform unless this page specifies other platform requirements.

オプション 詳細
-batchmode Run the application in “headless” mode. In this mode, the application doesn’t display anything or accept user input. This is useful for running servers for networked applications.
-disable-gpu-skinning Disables Graphics Processing Unit (GPU) skinning at startup.
-force-clamped Use this together with -force-glcoreXY to prevent checks for additional OpenGL extensions, allowing the application to run between platforms with the same code paths.
-force-d3d11-singlethreaded D3D11_CREATE_DEVICE_SINGLETHREADEDフラグで、DirectX 11.0 を強制的に作成します。
-force-device-index Make the Standalone Player use a specific GPU device by passing it the index of that GPU. This option is supported for D3D11, D3D12, Metal, and Vulkan graphics APIs, but isn’t supported for OpenGL.
-force-glcore Force the application to use the OpenGL core profile for rendering. The Editor tries to use the most recent OpenGL version available, and all OpenGL extensions exposed by the OpenGL drivers. Unity uses Direct3D if the platform doesn’t support OpenGL.
-force-glcoreXY Similar to -force-glcore, but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44, or 45.
-force-vulkan Force the application to use Vulkan for rendering.
-force-wayland (Linux only) Linux プレイヤーを実行するときに、実験的な Wayland サポートをアクティベートします。
-monitor N 指定されたモニター (1 ベースのインデックス番号で示されます) 上でスタンドアロンプレイヤーを実行します。
-nographics When you use this argument in batch mode, Unity doesn’t initialize a graphics device. This makes it possible to run your automated workflows on machines that don’t have a GPU.
-nolog Do not produce an output log. When you don’t use this argument, Unity writes the output_log.txt in the Log Files folder, where the Debug.Log output is printed.
-no-stereo-rendering ステレオレンダリングをオフにします。
-popupwindow Create the window as a pop-up window, without a frame. This command isn’t supported on macOS.
-screen-fullscreen デフォルトのフルスクリーン状態をオーバーライドします。値は 0 か 1 のいずれかです。
-screen-height デフォルトの画面の高さをオーバーライドします。サポートされている解像度の整数である必要があります。
-screen-width Override the default screen width. This width value must be an integer from a supported resolution.
-screen-quality デフォルトの画面の品質をオーバーライドします。使用例としては: /path/to/myGame -screen-quality Beautiful。サポートされるオプションは、 Quality 設定 名と一致します。
-force-low-power-device (macOS のみ) スタンドアロンプレイヤーに、低消費電力のデバイスを使用させます。
-force-metal (macOS のみ) スタンドアロンプレイヤーにデフォルトのグラフィックス API として Metal を使用させます。
-force-d3d11(Windows のみ) Force the application to use Direct3D 11 for rendering.
-force-d3d12 (Windows のみ) Force the application to use Direct3D 12 for rendering.
-force-d3d11-flip-model (Windows only) Force the application to use DXGI flip model swapchain when using Direct3D 11. For more information, see PlayerSettings.useFlipModelSwapchain.
-force-d3d11-bitblt-model (Windows only) Force the application to use DXGI BitBlt model swapchain when using Direct3D 11. For more information, see PlayerSettings.useFlipModelSwapchain.
--parentHWND <HWND> delayed (Windows only) Embed the Windows Standalone application into another application. When you use this argument, you need to pass the parent application’s window handle (‘HWND’) to the Windows Standalone application.

When you pass -parentHWND 'HWND' delayed, the Unity application is hidden while it runs. You must also call SetParent from the Microsoft Developer library for Unity in the application. Microsoft’s SetParent embeds the Unity window. When it creates Unity processes, the Unity window respects the position and size provided as part of Microsoft’s STARTUPINFO structure.

To resize the Unity window, check its GWLP_USERDATA in Microsoft’s GetWindowLongPtr function. Its lowest bit is set to 1 when the graphics initialize and it’s safe to resize. Its second lowest bit is set to 1 after the Unity splash screen finishes displaying.

For more information, see this downloadable example: EmbeddedWindow.zip
-single-instance (Linux と Windows のみ) Run only one instance of the application at the time. If another instance is already running then launching the application again with -single-instance focuses the existing one.
-window-mode (Windows のみ) Override fullscreen windowed mode. Accepted values are exclusive or borderless. For more information, see Standalone Player settings.

Universal Windows Platform command line arguments

Universal Windows Apps don’t accept command line arguments by default, so to pass them you need to call a special function from MainPage.xaml.cs/cpp or MainPage.cs/cpp. For example:

appCallbacks.AddCommandLineArg("-nolog");

この関数を appCallbacks.Initialize() 関数の前に呼び出します。

オプション 詳細
-force-d3d11-singlethreaded D3D11_CREATE_DEVICE_SINGLETHREADEDフラグで、DirectX 11.0 を強制的に作成します。
-force-driver-type-warp Force the DirectX 11.0 driver type WARP device. For more information, see Microsoft’s documentation on Windows Advanced Rasterization Platform.
-force-feature-level-9-3 DirectX 11.0 機能レベル 9.3 を強制します。
-force-feature-level-10-0 DirectX 11.0 機能レベル 10.0 を強制します。
-force-feature-level-10-1 DirectX 11.0 機能レベル 10.1 を強制します。
-force-feature-level-11-0 DirectX 11.0 機能レベル 11.0 を強制します。
-force-gfx-direct シングルスレッドレンダリングを強制します。
-nolog Don’t produce UnityPlayer.log.
Unity Editor command line arguments
バッチモードとビルトインコルーチンの互換性
Copyright © 2020 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961