1

I'm building a Unity app for which target environment must include Mixed Reality. I've been able to find very good file picker assets on the assets store, but none of these seem to work in the Mixed Reality Headset, although they appear on screen even in VR mode.

Are there any default MR assets that I should be using or is there anything I should be looking for? Or do I have to build all this from scratch?

Thanks

Francois Gagnon
  • 362
  • 4
  • 20
  • Probably a better forum to ask that kind of question would be the Unity forums: https://forum.unity.com/ – AndreasHassing Oct 18 '18 at 11:00
  • Congrats on finding a file picker that works (mostly). Mind linking it? The last time I was working with the Hololens it was straight up not possible. – Draco18s no longer trusts SE Oct 19 '18 at 01:14
  • @Draco18s, well, it's not working just yet! lol! – Francois Gagnon Oct 19 '18 at 12:39
  • A year and a half ago Microsoft themselves listed it as "you can't" because the file system wasn't accessible, their suggested workaround was making an external call to OneDrive. So if you've gotten past that, you're doing well! – Draco18s no longer trusts SE Oct 19 '18 at 16:03
  • Well, Draco, there good apps out there that do use it (for example video or slide viewers where you can pick the file you want to see). I don't know why MS wouldn't like it or try to help, but hey! if this is something many people want there's got to be a good reason for it: it's needed... – Francois Gagnon Oct 19 '18 at 16:10

2 Answers2

1

The difference in VR is that there's no cursor, so normal EventSystem doesnt work out of the box. The simplest workaround that worked for me was this: Add a box collider component to your UI elements. Raycast from the controller against box colliders. If the collider has a component that implements IPointerClickHandler interface, you can fire OnPointerClick(PointerEventData e) method against it and it will be considered a valid click (although thah bypasses eventsystem navigation).

You'll need to pass a PointerEventData object, I can't remember if you can just pass a null, but I am pretty sure passing a new PointerEventData(EventSystems.current) is fine.

For drags and more complicated events you might need to fill some additional fields for the UI to behave correctly

zambari
  • 4,797
  • 1
  • 12
  • 22
0

I ended up writing my own file picker using the "file manager" assetpurchased from the asset store and the mixed reality toolkit. Would it be worthwhile for me to put it on the asset store or is this overtaken by events now that we're have a better mrtk available?

Francois Gagnon
  • 362
  • 4
  • 20