Hello everyone.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Options
#if HOLOLENS ?
Lane
✭
Is there a platform dependent compilation for the Hololens?
Example:
#if HOLOLENS
Debug.Log("Hololens!");
#endif
1
Answers
#if UNITY_WSA_10_0
or
#if WINDOWS_UWP
http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
These will still fire if its a Universal Windows flat app, there needs to be a platform specific #if for just HOLOLENS if it doenst already exist.
You could always create one, just add HOLOLENS to your projects build tab Conditional Compilation Symbols. I agree with you, a universal one defined by Microsoft is best, but in the mean time there is at least a work around, and later you can just string replace to the new one if Microsoft defines one.
I believe, and I could be wrong on this, but you would use the
#if WINDOWS_UWP
and then within that check for the Windows 10 Device Family. This would tell you if it was a HoloLens or not.AnalyticsVersionInfo class