yasirkula / UnityAssetUsageDetector

Find usages of the selected asset(s) and/or Object(s) in your Unity project, i.e. list the objects that refer to them
MIT License
1.74k stars 118 forks source link

Unable to open read only scene thrown with "addressables support" clicked #36

Closed petergiuntoli closed 1 year ago

petergiuntoli commented 1 year ago

image

Description of the bug

When searching for assets with the addressables support option clicked it appears like we can attempt to load readonly template scens that exist inside packages. My example is ArgumentException: Cannot open scene with path "Packages/com.unity.render-pipelines.universal/Editor/SceneTemplates/Basic.unity".

Reproduction steps

I think all that is required is to have a project with the URP package installed and to attempt to search with the addressables support option clicked.

Platform specs

For references, our unity version is 2022.3.6 and here is our manifests.json

{
  "dependencies": {
    "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.3.3",
    "com.dgreenheck.openfracture": "https://github.com/dgreenheck/OpenFracture.git",
    "com.rlabrecque.steamworks.net": "https://github.com/rlabrecque/Steamworks.NET.git?path=/com.rlabrecque.steamworks.net#20.2.0",
    "com.unity.2d.psdimporter": "8.0.2",
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.addressables": "1.21.17",
    "com.unity.ai.navigation": "1.1.4",
    "com.unity.cinemachine": "2.9.7",
    "com.unity.collab-proxy": "2.0.5",
    "com.unity.ide.rider": "3.0.24",
    "com.unity.ide.visualstudio": "2.0.22",
    "com.unity.ide.vscode": "1.2.5",
    "com.unity.inputsystem": "1.6.3",
    "com.unity.memoryprofiler": "1.0.0",
    "com.unity.postprocessing": "3.2.2",
    "com.unity.probuilder": "5.1.1",
    "com.unity.profiling.core": "1.0.2",
    "com.unity.render-pipelines.universal": "14.0.8",
    "com.unity.test-framework": "1.1.33",
    "com.unity.textmeshpro": "3.0.6",
    "com.unity.timeline": "1.7.5",
    "com.unity.toolchain.macos-arm64-linux-x86_64": "2.0.0",
    "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6",
    "com.unity.ugui": "1.0.0",
    "com.unity.visualscripting": "1.8.0",
    "com.veriorpies.parrelsync": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync",
    "com.yasirkula.assetusagedetector": "https://github.com/yasirkula/UnityAssetUsageDetector.git",
    "jp.hadashikick.vcontainer": "https://github.com/hadashiA/VContainer.git?path=VContainer/Assets/VContainer#1.13.2",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}
yasirkula commented 1 year ago

Thank you for bringing this to my attention and the proposed solution! I've tried a different approach that ignores scenes inside read-only packages only, not affecting scenes inside mutable (embedded/local) packages. Could you give it a try when you get the chance?

petergiuntoli commented 1 year ago

Pulled down the change and it looks fixed. Thanks!