- Home /
How to check what prefabs exist in one of the project folders? (not necessarily in Resources)
Hey all. Just as title says - I need to check what prefabs exist in specific project folder (e.g. "Assets/FunnyFolder/NotFunnyFolder/")
I tried using AssetsDatabase and PrefabUtility, but I can't work it out. My last try was:
string[] assets = AssetDatabase.FindAssets("Assets/UglyFolder/");
Debug.Log(assets[0]);
I also googled and the only workaround I found, someone posted to use System.IO which I would prefer to avoid.
Any ideas?
Answer by FortisVenaliter · May 19, 2016 at 09:50 PM
I don't believe it's possible. The way Unity works, only Resources are enumerated. The rest of the prefabs/assets are either baked into scenes, or not included in the final build, so even if you could do this, it would be Editor-only, so you might as well use System.IO.
Yeah, I need it for editor-only. But still I'd rather want to avoid System.IO. I am just hoping there is some other workaround.