Search Issue Tracker
Fixed in 2021.3.15f1
Fixed in 2020.3.43f1
Votes
0
Found in
2020.3.42f1
Issue ID
UUM-20571
Regression
Yes
AssetDatabase.FindAssets behaviour is bugged when using filters as of 2021.3.14
Steps to reproduce:
1. Download the attached user's project "UnityBugFindAssets.zip"
2. Open the project in 2021.3.13f1
3. Select the menu item "TestSelect/select"
4. In the Console Window log you shall see the following:
"Assets/Triangle/TriangleTexture.png
Assets/Square/SquareTexture.png
Assets/Circle/CircleTexture.png"
5. Close the project and reopen it in 2021.3.14f1 and repeat step 3
6. In the Console Window log you shall see the following:
"Assets/Triangle/TriangleTexture.png
Assets/Square/SquareAnimation.anim
Assets/Square/SquareTexture.png
Assets/Circle/CircleMaterial.mat
Assets/Circle/CircleTexture.png"
Expected results: Only the texture files shall be returned and printed to the console, as per the Texture2D filter added to the FindAssets call in TestSelect.cs
Actual results: 2021.3.14f1 only sees the expected results with the first path in the array, returning TriangleTexture.png. However, subsequent paths return all assets and not just the textures. For example, Assets/Square returns both "SquareAnimation.anim" and "SquareTexture.png" despite the Texture2D filter being present in the FindAssets call in TestSelect.cs
Reproducible on: 2020.3.42f1, 2021.3.14f1, 2022.1.22f1, 2022.2.0b14,
Not reproducible on: 2020.3.41f1, 2021.3.13f1, 2022.1.21f1, 2022.2.0b13, 2023.1.0a21
Notes:
-When AssetDatabase.FindAssets is used with a filter and an array of paths to be searched, it typically looks through the path and returns only the assets that are present in those paths based on the filter. However, as of 2021.3.14 when using a Texture2D filter with an array of multiple paths, only the first path to search seems to respect the filters presence. All subsequent paths in the search array shall return all assets in that path, regardless of their type.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note (fix version 2021.3.15f1):
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-19314
Resolution Note (fix version 2020.3.43f1):
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-19314