Closed zantiu closed 3 years ago
@zantiu Can you describe the incorrect behavior you are seeing? Also, please include version info (WLT, Unity, XR Plugin), and basic configuration (especially WLT anchor management subsystem). Thanks!
Well I got an error in our own project where we based parts of our code on a previous version of this sample. I just upgraded to OpenXR so I also needed to adjust the relevant code.
The error was that Microsoft.MixedReality.OpenXR could not be found. The error went away when adding it as a reference in the Assembly Definition.
Then comparing back to your sample you don't have it as a reference.
Version info: WLT: 1.5.4 Unity: 2020.3.8f1 Windows XR Plugin: 4.4.2 WLT Anchor Subsystem: XRSDK
Anyway the QR code scanning works again. Now I just need to review if the rest of WLT still works correctly.
Was the error at build or just in Unity when loading? Did it reference a specific script code trying to reference OpenXR?
Also, you say you are using Windows XR Plugin 4.4.2, how are you also using OpenXR?
I'm finding this very confusing, partly because the QRSpacePin.asmdef does have a reference to OpenXR.
There was an API change going from Windows XR Plugin to MS OpenXR Plugin, and the code selectively includes the old way or the new way based on whether the OpenXR plugin is included using Version Defines.
That's why I would be very interested in details of a break involving the presence or absence of the OpenXR plugin, as the code should compile fine (but differently) either way.
Was the error at build or just in Unity when loading? Did it reference a specific script code trying to reference OpenXR?
Also, you say you are using Windows XR Plugin 4.4.2, how are you also using OpenXR?
Yes I think Windows XR Plugin is irrelevant because the project settings have been changed to use OpenXR.
Ok now I understand.
I did not try to run your sample, I just compared the code. And when I looked in Unity for the assembly references I saw this:
The last assembly is greyed out, maybe because the package has not been imported yet in Unity. And that must be Microsoft.MixedReality.OpenXR.
So my issue was that OpenXR is present, but I didn't add it as an Assembly Definition Reference. Then I indeed have the same version define as you, detecting OpenXR, but Visual studio immediately gave an error on the line 'using Microsoft.MixedReality.OpenXR;' because the assembly reference was missing.
So this can be closed.
Shouldn't there also be a reference to Microsoft.MixedReality.OpenXR in following Assembly Definition? :
Assets/QRSpacePin/QRSpacePin.asmdef