microsoft / MixedReality-SpectatorView

Mixed reality spectator experiences
MIT License
193 stars 114 forks source link

I managed to run the sample on Unity 2019.4 #462

Open ShumWengSang opened 2 years ago

ShumWengSang commented 2 years ago

Many people in the Issues asked how to run the samples on Unity 2019.4, and I managed to run the example. I'll share what I did to get it to run so that others can hopefully avoid the time I spent experimenting and trying it out. Maybe someone with more knowledge can also fix my workarounds.

Maybe this isn't hard for experienced people, but it took a good long day to figure it all out.

To be clear, I ran the "Build2019Demo.Unity".

Relevant prerequisites

Below is the hardware and Unity version I use. HoloLens 1st Gen Unity 2019.4.34f1 Windows 10 Android OnePlus 5T

What I did

  1. Clone master (commit 7796da6acb0ae41bed1b9e0e9d1c5c683b4b8374 when I did it)
  2. Follow the repo's instructions
    • Run tools\scripts\CreateUnityPackage.bat in an administrator cmd window
  3. Now, I can use Unity to open the project. I still had some compiling errors on Unity
  4. Change packages used
    • I followed this link, which allows ASA to work with 2019.3
    • There is probably a way to update this package in the bat file process itself, but I didn't look into it
    • I updated the following libraries to these versions
      • AR Foundation: 3.1.3
      • ARCore XR Plugin: 3.1.3
      • ARKit XR Plugin 3.1.3
  5. If your AR Foundation gives you compilation problems regarding obsolete API, check if it's something in 'Assets\AzureSpatialAnchors.SDK\Scripts\SpatialAnchorManager.cs'.
    • If it is, follow the same link in step 4, "Update the ASA SDK to ARFoundation 3 objects" part.
  6. Now, the only problems should be coming from Text Mesh Pro. I removed references to ignoreRectMaskCulling
  7. If Unity ever complains about upgrading API, just say yes.
  8. After changing platforms for UWP/ Android, I did not have any compilation issues.
  9. At this point, you can follow the instructions in the repo again.
  10. I ran on HoloLens and managed to connect with my Android OnePlus 5T phone
ShumWengSang commented 2 years ago

I will leave this open until someone else decides to close it.