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.
Running code that isn't a script in Unity App
Is it possible to use/run C# classes that are not scripts attached to gameobjects when a Unity App is running? Meaning I want to be able to build the Unity app then add code in Visual Studio that has some functionality. Then build/run that project on the hololens and have that code be executed while the Unity app is running. If so, where would I reference these classes and their methods? If not, does that mean all C# code has to be attached to a gameobject to function in the Unity App on the hololens.
Best Answer
-
OptionsPatrick mod
You can add a class to your project and reference it just like you would from any other project. Unity is still going to see the file and I think it will try to 'compile' the class as well, so you might have to wrap newer functionality in #if WINDOWS_UWP blocks.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.(Daddy, what does 'now formatting drive C:' mean?)
5
Answers
You can add a class to your project and reference it just like you would from any other project. Unity is still going to see the file and I think it will try to 'compile' the class as well, so you might have to wrap newer functionality in #if WINDOWS_UWP blocks.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.
(Daddy, what does 'now formatting drive C:' mean?)
.