This projects enables the use of the Microsoft Radial Controller inside of a non-UWP Unity Windows Desktop application.
View the Changelog for details changes/improvements in each version.
I needed to get close to native functionality of the Microsoft Surface Dial working inside of a Unity application that is NOT built for UWP.
The Microsoft Surface Dial API provided by Microsoft is intended for UWP apps but building a UWP app in Unity is laborious and includes lots of unnecessary overhead for the average Unity project. This project's original goal was to provide Surface Dial controls to a Unity Windows Desktop application without the need to make the Unity application a UWP app.
The RadialControllerUnity
folder is a functioning example project with all necessary components to get a Radial Controller working in Unity.
To get started using a Radial Controller in your own Unity Project do the following:
Download & import the latest .unitypackage
from the GitHub releases page of this repository.
- Copy this folder to your project's Asset folder:
RadialControllerUnity/RadialController
- Copy this executable to your project's StreamingAssets folder.
RadialControllerUnity/StreamingAssets/RadialControllerServer.exe
- In your Unity scene, attach the
RadialController
component to a GameObject. - Hook up event handlers to the various
RadialController
components UnityEvents and do all your Unity game logic from there.
When you play your Unity project, the RadialController
Unity component will attempt to create a bridge to communicate with the Radial Controller device depending on the platform being run on.
NOTE: Currently Windows 10 is the only supported platform.
RadialControllerWindowsBridge
is created by theRadialController
component to communicate with the Radial Controller device on Windows.- The windows bridge starts the side-process application
RadialControllerServer.exe
. This is a simple Windows desktop application that registers itself with the Radial Controller through the official Microsoft Windows Radial Controller API for Windows 10. - The server application pipes events received from the official Windows API to Unity through a local socket connection using the .NET
UDPClient
. TheRadialControllerWindowsBridge
receives the events from the server and processes them and turns them into UnityEvents that are easy to use inside of any Unity application.
If you wish to contribute to this project feel free to open up a pull request and I will review it for inclusion. The Unity-side is designed as such that it should be easy to extend its capability to other platforms by extending from IRadialControllerPlatformBridge
and providing platform specific functionality.
Same goes for bug fixes, if you find any, feel free to open up an Issue here on the GitHub repo or fix it yourself and create a pull request so we may all benefit.