microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

MixedRealityToolkitFiles class is specific to the Assets folder and could use some improvements #8094

Closed keveleigh closed 2 years ago

keveleigh commented 4 years ago

Describe the bug

The MixedRealityToolkitFiles class has some strong assumptions that the MRTK will only ever be present in the Assets folder of a project. #8058 does some good initial work to expand the scope of this expectation, but with the ability to reference a local UPM package by path makes it impossible to support all cases by manually adding specific folders.

Unity provides a way to search and load assets from UPM packages in a generic way via the AssetDatabase APIs. This could be used in a few different ways:

  1. Use AssetDatabase.FindAssets to locate the sentinel files, which will give us an AssetDatabase-compatible path to the well-known folders.
  2. Use GUID references to load assets instead of hard-coded paths, which can be more robust to file / folder / package name changes, as well as how the package or asset is consumed.
  3. Use AssetDatabase.FindAssets to locate specifically-named assets, like the default profiles.

and probably other ways I'm not thinking of right now.

david-c-kline commented 4 years ago

The call stack for searching for the MRTK folders includes:

At no point in the above is it possible to early exit from the SearchForFolders loop.

stale[bot] commented 3 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

stale[bot] commented 2 years ago

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.