- Home /
How do I exclude Unity's assets in results from from AssetDatabase.FindAssets?
I wrote an editor script tool to find all textures in the project, which are not power of two sized, and not in an Atlas.... It mostly works... The problem is, unity also returns a whole bunch of other textures, that if you search for them by the name that unity gives in the project window ... they are not in the project hierarchy anywhere.. defeating the effectiveness of the tool. I am guessing these 'noise' textures are unity standard assets, Editor icons, possibly textures in libraries or plugins etc.... I just want my own project's textures. So how would I go about doing that? The path for all those assets is not a path, it's just a guid, so I cant filter by asset path either.
unity 2019.2.7
any ideas appreciated. Thanks in advance.
Answer by JonPQ · Mar 20, 2021 at 12:48 AM
I'll answer my own question... load the asset by guid, then get the actual path.... string assetPath = AssetDatabase.GetAssetPath( asset ); then filter on the path string.
Answer by MvNimwegen · Feb 21 at 08:51 AM
I am hoping that there is a filer option for this.. Filtering yourself afterwards seems very inefficient.
Your answer
![](https://koobas.hobune.stream/wayback/20220613031000im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
ScriptableObject not saving data to asset 2 Answers
Unity recompilation time slowly increases each time it's recompiled. Why? 0 Answers
Why would AssetDatabase.CopyAsset return false? 2 Answers
AssetDataBase.ImportAsset not triggering AssetProcessor.PreProcessModel 0 Answers
How do I save assets from an asset bundle in the Editor? 1 Answer