Version: 2017.3
入门
运行您的第一个应用程序

设置

项目设置

A Unity project for Microsoft Holographic platform isn’t very different to a Unity project for other platforms, with a few notable exceptions:

  • 确保要用于跟踪 HoloLens 设备位置的摄像机在 Inspector 窗口中标记为 Main Camera。应事先正确标记场景中的默认摄像机。
  • Main CameraBackground 属性设置为 Solid Color 而不是默认的 Skybox。将背景颜色设置为 (0, 0, 0, 0)。
  • Use the Fastest Quality Settings in Edit > Project Settings > Quality. This maximizes performance and reduces power consumption. In particular, soft shadows and shadow cascades are too expensive to use on the HoloLens, and should be avoided.
  • 根据应用程序使用的子系统启用相应的发布标志。

要了解更多信息,请参阅 Microsoft 的 Unity 性能建议 (Performance recommendations for Unity) 文档。

Publishing settings

The following capability flags are provided under Player Settings > Publishing Settings. System features fail if you don’t enable the appropriate capability flags.

Not all of the publishing settings below are specific to Windows Holographic. For more information, see Unity’s documentation on WSA Player Settings.

PicturesLibrary 用于 PhotoCapture 捕获摄像机取景框功能。
MusicLibrary 用于 VideoCapture 音频录制功能。
VideosLibrary 用于 VideoCapture 视频录制功能。
WebCam 用于 PhotoCaptureVideoCapture
Microphone 用于语音识别。
SpatialPerception 用于空间映射。

导出 Visual Studio 解决方案

构建完项目并准备好进行测试后,请将项目导出到 Visual Studio 解决方案。要针对 Windows Holographic 进行构建,请选择 File > Build Setting 下的以下选项:

  • Platform:Universal Windows Platform
  • UWP Build Type:D3D 或 XAML
  • __Unity C# Projects__(选中此复选框)

Under Player Settings > Other Settings:

  • 启用 Virtual Reality Supported
  • 单击 Virtual Reality Devices 列表中的 + 按钮,然后选择 Windows Holographic

Checking the Unity C# Projects checkbox includes your scripting files in their own project in the generated solution. This allows you to conveniently edit and debug your scripts without needing to re-export from Unity. A re-export is only required if your project settings or content change.

请参阅 Microsoft 关于导出和构建 Unity Visual Studio 解决方案 (Exporting and building a Unity Visual Studio solution) 的文档以了解更多详细信息。


• 2017–05–16 页面已修订但未经编辑审查

入门
运行您的第一个应用程序