Filling in the blanks

In this section, we will finally make sure that our network code can understand our object by spawning it with network-friendly code. Instead of turning our skee object on or off based on certain conditions, we will spawn it into the game using the PrefabSpawnManager.

The PrefabSpawnManager class takes a Prefab and converts it into data types that can easily be translated across a network. This makes for a far more efficient use of objects:

To begin, click on that Add Component button shown in the preceding screenshot. Scroll down to New Script, type SyncSpawnSkee in the box, make sure that C Sharp is selected, and click ...

Get HoloLens Beginner’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.