Inspiration
Given the theme of "A New Solution to an Old Problem," I wanted to participate in the Dev Days Hackathon with a simple concept that would allow me to show off some MR development on my live stream, and that would make progress towards a larger goal of interacting with a suite of hardware devices from Hololens & Unity. To this end, building an interface for turning on and off a hardware device felt like a good fit.
What it does
This app provides a server-authoritative environment to control a Nanoleaf Light Panel device by sending a state-change message through its REST interface. Multiple clients can be connected to the server to have access to this ability, but only the server will interact with the hardware devices.
How we built it
Built on top of the new Netcode for Gameobjects package for Unity and MRTK3. A simple configuration file is used to set up the network properties. Makes use of several prefabs to accomplish this: UX buttons, XRRig, XRInputSimulator. Nanoleaf Manager is a singleton object that maintains the Nanoleaf device state and can communicate based on loaded configuration.
Challenges we ran into
- The update to Netcode 1.0.0 seemed to break communication between HL2 and PC -- I had to rebuild the app from scratch to get it working again
- I attempted to use mDNS to discover available Nanoleaf devices on the local network, but any C#/.NET mDNS libraries I could find weren't working in Unity
- MRTK3 doesn't seem to ship with the same REST utilities as MRTK2, so a third party package was used instead
- Iteration time to build and run on HL2 is very slow and painful -- which is necessary to properly test network communication
Accomplishments that we're proud of
- It works!
- Have a solid platform to represent digital twins of physical devices and interact with them
What we learned
- Netcode for Gameobjects
- MRTK3
- Nanoleaf APIs
What's next for MR Light Switch
The concepts behind this project will continue to be developed into a more robust and feature rich tool. This technology will be used to drive location-based, immersive mixed-reality experiences in the future.

Log in or sign up for Devpost to join the conversation.