- Microsoft HoloLens Developer's Guide
- Dennis Vroegop
- 523字
- 2021-07-02 19:08:02
Building the project
Of course, before building your project, it is a good idea to save it. If you click on Save or use the Ctrl+S key combination, Unity will ask you to save your scene. A scene is a collection of objects laid out in a 3D world. In our case, this is the collection containing the light source, the camera, and our sphere. Just give your scene a name, I used main and placed that in the subfolder Scenes under Assets (which is the default).
When you have saved your project, we can start to build the code. However, before we do that, we have to tell Unity that we are working on a Windows Holographic application. To do that, do the following:
- Go the File | Build Settings or press Ctrl + Shift + B.
- In the dialog you see now, press the Add open scenes button. This makes sure that our current scene is part of the package.
- In the platform selection box, we can choose for which platform we would like to build our app. As you can see, there is quite a large choice of platforms, but we will choose Windows Store and then click on the Switch Platform button. You can tell we now have this platform as the default by the appearance of the Unity logo behind the Windows Store option.
- On the right-hand side, we can set specific Windows Store options.
- SDK: Windows 10.
- UWP Build Type: D3D (meaning DirectX 3D).
- Build and Run does not matter here; we can leave that.
- Check Unity C# Projects.
- Check Development Build.

- Now, before we press Build, we need to do one more thing--click on the Player Settings... button. This is where you set the properties for the Unity Player, thus the application that loads the scenes and performs the animations, interactions, and so on. We, however, do not use the Unity Player but use our own. Still, we need to set one very important property:
- Click on Player Settings, and see that the Inspector changes.
- Click on Other Settings.
- Check Virtual Reality Supported and verify that the Virtual Reality SDK contains Windows Holographic. This makes sure that we have two cameras when we run the app.
- Now, we can press Build. Unity will ask us for a place to put the C# and Visual Studio files. I usually create a folder in the current folder with the name App. Press Select Folder and Unity will build the code for us.
The first time you do this, you will notice this takes some time. It has to generate quite a lot of files, and it needs to package up all our assets. The next time only the changes need to be processed, so it will be much quicker.
When the building is done, Unity will open an Explorer window where our project is. You will see the newly created App folder. If you open that, you will find the .sln file, in my case HelloHoloOnUnity.sln. This is a Visual Studio solution file we can open in Visual Studio. Let's do this!
- Learning Python Web Penetration Testing
- Java 開發從入門到精通(第2版)
- R語言經典實例(原書第2版)
- INSTANT Sencha Touch
- Mastering Rust
- Python之光:Python編程入門與實戰
- BeagleBone Black Cookbook
- 編程菜鳥學Python數據分析
- Visual Studio 2015高級編程(第6版)
- R語言數據可視化:科技圖表繪制
- JavaScript動態網頁編程
- Java程序設計與項目案例教程
- App Inventor少兒趣味編程動手做
- Moodle 3 Administration(Third Edition)
- Python預測分析實戰