简体   繁体   中英

implementing QR code scanning on a unity HoloLens2 app

I am trying to implement QR code scanning for my Hololens2 AR app on unity and I can't seem to figure it out. There is Microsoft documentation here ( https://docs.microsoft.com/en-us/windows/mixed-reality/develop/platform-capabilities-and-apis/qr-code-tracking ), but this documentation does not show how to implement using C# scripts (which is what would be ideal). It points to a confusing example project which does not run on my end. I have looked around and can not seem to find any helpful guides for implementing this.

If anyone has done this before or knows how to, could you help out?

Create a brand new MixedReality project, copy the scripts and prefabs from that project, add a GameObject to your scene (eg QRCodeManager) and attach QRCodeManager.cs and QRCodeHandler.cs to it. You can tick "Auto Start QR Tracking" in QRCodesManager (in Unity Editor) in order to start scanning for QRCodes by default. QRCodesVisualizer.cs deals with QRCode detection events (HandleEvents()). If you are using the scripts as they are, as soon as a QRCode is detected you will have a visual confirmation.

If you are still waiting... I have installed the same project and Deploy it in Hololens 2. It worked fine. Here is what I have done. If you have not already, create a github account and Clone the project (SampleQRCodes). You can open it from Unity Hub or just go to the directory, then Assets > Scenes and open [QRCodesSample.unty]. Its all set actually. Nothing to do. Change the Platform from [PC, Mac & Linux Standalone] to [Universal Windows Platform], then [Switch platform]. I assume that you know how to Deploy it in Hololens 2. If not please tell. Its simple. You need VS 2019 (professional). Community won't work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM