Connecting from Unity3D

We can use our server as a source for Unity3D apps as well. But I have to warn you: the code will look ugly. We will fix this more or less in the next chapter, but for now we just have to live with it.

Create a new Unity3D project and set it up to target the HoloLens. Add something interesting to the scene, such as a cube somewhere. Attach a new script to that cube. This should not pose a problem anymore as we have done it numerous times.

Open the script in Visual Studio.

We do not need Json.NET here. Unity3D has built-in support for JSON. However, the way this library handles JSON data is slightly different, so we have to modify our data structure a bit. This is what I added to my code file:

 [Serializable] public ...

Get Microsoft HoloLens Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.