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.
Options

Best Practices for buttonHandling in Menu with HoloLens

Dear WHDF,

I was wondering what the best practices are for handling buttons in a menu? I know you can attach a script to an object and that the focused object will be able to determine which it is but that requires you to make a single script for each button if you do not want to load it every time.

Now I have attached the script to every object which it requires but I found out that this actually loads the start of the script several times because of this which is a big performance issue if you ask me.

If I Attach it only to a panel the FocusedObject will not detect the button when you select it but always the panel, and only attaching the required objects to the assigent object creates nullpointers. (As in the image)

What is the best way for the HoloLens with Unity to do buttenhandling in Unity so that it works and gives the best performance.

Kr,

Tagged:

Best Answer

Answers

  • Options

    @BillMcCrary thanks for this answer! this helps alot and i will definitly try this. did you place this eventsystem on every button or something else? Kr,

  • Options

    and btw doesn't this still require you to make a script for every case if you for example want to change the text somewhere you still need a @pub variable which you need to assign in every button if you use the same script to avoid nullpointers.

  • Options

    You could add null checking where appropriate to avoid too many wire-ups. If you use the broadcast/send message methods that could keep things a little cleaner.

  • Options
    TvtTvt
    edited March 2017

    @BillMcCrary thanks for the reply, this method worked perfectly for all menu's

    let's hope MS one day releases good documentation about this someday.

Sign In or Register to comment.