Standalone Player command line argument “-adapter” syntax

跟風遠走 提交于 2019-12-24 05:47:29

问题


I need to select the monitor my game is displayed on from the command line for dual monitor systems. If I use the Unity Screen Selector Dialog it gives me the choice of which monitor I want to display the game on when starting the game, and it works fine. When I try loading the game from the command line with the command line argument: "MyGame -adapter 1" or "MyGame -adapter 2" it seems to ignore the argument, and just loads the game on the same monitor every time.

Notes: I have a dual monitor system, but only one video card (GeForce GT 740). I am using Unity 5.6.1f1 (64-bit), and Window 10.

Please let me know what I am missing.


回答1:


This is a known bug and it doesn't seem to be fixed at this time. The -adapter argument does not work with any Direct3D above 9.

Go to File --> Build Settings, select your PC Windows platform then go to Other Settings.

From here, disable the Auto Graphics API for Windows checkbox.

You will be given option to chose which Direct3D to use. Make to remove all other Direct3D version and simply just put Direct3D9 there. The 9th version should until Unity fixes this bug.


If that does not work:

Go to File --> Build Settings, select your PC Windows platform then go to Resolution and Presentation.

Disable "Default Is Full Screen" and "Display Resolution Dialog".


Again, if that fails, use the Display API to do through code. You can find more information about that here. I also suggest that you file for a bug report too.



来源:https://stackoverflow.com/questions/44792385/standalone-player-command-line-argument-adapter-syntax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!