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.
Create Unity elements from C# for an App, not a Game
Hi,
I am trying to create an App (not a Game) using Unity elements (ex: Spheres)
From what I have read, a game is continuously refreshed and uses a lot of resources.
I have read that an App will use the messaging queue (if I am not mistaken) instead to refresh only when needed.
My problem is that I cannot find an sample online showing this process.
Is there anyone that could point me to a sample for this ?
Thank you in advance.
Best Answer
-
thebanjomatic ✭✭✭
Hey Zorglub,
The "game loop" is sort of a necessity because you need to constantly re-render from new perspectives as the camera (your head) moves around the scene.
That being said, its still a good idea to not do extra work when you don't have to. In Unity, you can reduce the amount of work that happens every frame by not having an "Update" function inside of the scripts you attach to game objects. By default it creates an empty Update function when you create a new script... delete that if you don't need it. An empty Update function still gets called by Unity and has some small overhead.
http://blogs.unity3d.com/2015/12/23/1k-update-calls/
You can than basically use SendMessage or more direct methods of event handling. For example, you can set a game object to respond to the OnSelect message, and then call into your application logic from there.
5
Answers
Hey Zorglub,
The "game loop" is sort of a necessity because you need to constantly re-render from new perspectives as the camera (your head) moves around the scene.
That being said, its still a good idea to not do extra work when you don't have to. In Unity, you can reduce the amount of work that happens every frame by not having an "Update" function inside of the scripts you attach to game objects. By default it creates an empty Update function when you create a new script... delete that if you don't need it. An empty Update function still gets called by Unity and has some small overhead.
http://blogs.unity3d.com/2015/12/23/1k-update-calls/
You can than basically use SendMessage or more direct methods of event handling. For example, you can set a game object to respond to the OnSelect message, and then call into your application logic from there.
That's the kind of answer I was looking for. Thanks a lot for clearing that point.
And the sample