AssetList not working on SubAssets, only finds the first one.

Issue #830 new
František Holubec created an issue

I have couple of scriptable objects as subassets of one major asset, when using AssetList attribute to search all assets of the type of those subassets, it only finds the first one. I did not try it but i guess this might be problematic with FBX subassets too.

Usually this happens when using AssetDatabase.LoadAssetAtPath<T>(path)

what i am doing instead is something like this:

foreach (var asset in AssetDatabase.LoadAllAssetsAtPath(path))
{
  if (asset is T tAsset)
  {
    yield return tAsset;
  }
}

this will find all the assets…

In odin this is in file AssetUtilities.cs, Replacing it will fix the issue 🙂

Meanwhile i created my own version of AssetListAttribute using my Own AssetListUtilities, I attached my custom Utilities for inspiration (based on decompiled code).

I am on Unity 2020.3.23, Odin 3.0.12 - Editor Only Mode Enabled, Windows 10, but in this case i guess its irrelevant 😉

Comments (3)

  1. Log in to comment