Skip to content

cookieofcode/hololens2-unity-uwp-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HoloLens 2 Unity UWP Starter

This repository provides a template for creating a HoloLens 2 Unity application using Universal Windows Platform (UWP) capabilities. The project was built using the following versions:

  • Unity Version: Unity 2019.4.11f1.
  • Mixed Reality Toolkit Version: MRTK 2.4.0.

Overview

You can use this repository to get started with HoloLens 2 development with Unity and UWP. The Unity Editor has no Windows Runitme support, so in Unity project's scripts you can use the ENABLE_WINMD_SUPPORT #define directive (see IL2CPP-WindowsRuntimeSupport).

Some UWP features, such as the HoloLens 2 camera access, can not be used in the HoloLens 2 emulator. This introduces a long cycle until written code in Unity can be visualized, as it has to be deployed using IL2CPP on the HoloLens 2.

To ease development effort and provide faster feedback, this starter combines resources of a C# holographic DirectX project and Unity using MRTK in a shared resources folder. This enables fast UWP dependent development using the C# project of resources, that can be used in the Unity solution.

This starter demonstrates the Microsoft Holographic face tracking sample. It shows how to acquire video frames from the camera and use the UWP FaceAnalysis API to determine if there are any faces in front of the HoloLens and a display a cube on top of the detected face.

Holographic DirectX project

The C# project is created using the Windows Mixed Reality App Templates available in VisualStudio. The face tracking visualization is converted to C# from Holographic face tracking sample.

Unity project

The Unity project contains the MixedRealityToolkit (MRTK).

Shared Resources

The shared resources contain code for both Unity and C# projects. The provided createSymlink.bat creates the symlink of the folder in the solutions. Before executing, ensure that the following folders exist:

  • .\UWP\Shared (The Shared Resources folder)
  • .\Unity\Assets\Scripts
  • .\UWP\CSharp\

Acknowledgment

The provided sample code origins from https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/HolographicFaceTracking and is licensed under the MIT license. The code has been converted from C++ to C#.

About

Starter for eased HoloLens 2 development using UWP in Unity.

Topics

Resources

License

Stars

Watchers

Forks

Languages