unity-game-engine - Unity 多显示器不工作

标签 unity-game-engine

我正在使用 Unity 5.4.1f1 个人版并进行 Windows 独立构建。我想在我的游戏中使用多个显示器。我有 2 个摄像头,并将其中一个摄像头的目标显示设置为显示 1,将第二个摄像头的目标显示设置为显示 2。

此外,我已经激活了显示,但在编辑器和构建上Display.displays.Length 始终为1

所以它不会在第二个屏幕上显示任何内容。我应该怎么做才能在第二个屏幕上显示?

最佳答案

您需要使用 Display.Activate 激活代码中的每个附加显示。

参见the docs它说:

The best time to activate additional displays is upon creating a new Scene. A good way to do this is to attach a script component to the default Camera. Make sure you call Display.Activate only once during the startup. You may find it helpful to create a small initial scene to test it.

从示例中,在 Start() 方法中:

if (Display.displays.Length > 1)
    Display.displays[1].Activate();
if (Display.displays.Length > 2)
    Display.displays[2].Activate();

注意:监视器一旦激活,您就无法将其停用。

关于unity-game-engine - Unity 多显示器不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43066541/

相关文章:

c# - 如何将Unity移动应用程序连接到Azure SQL数据库?

unity-game-engine - Unity3d 使用 CreateSpecificCulture

c# - Unity 编辑器脚本 - 使用 MouseOver 获取游戏对象

c# - 接口(interface)、委托(delegate)还是其他? (C#、统一)

python - 正确设置 Unity SerializedProperty 值

c# - 如何在 Unity 中创建一个可以显示由许多小图像组成的纹理的着色器

c# - 有没有办法留在协程中直到满足条件?

c# - 在基于事件的架构中通过 UnityEvent 传递数据

performance - Unity3D 中的rigidbody.velocity 与 lerp 效率

unity-game-engine - Shader saturate() 在不应该创建渐变的情况下创建渐变