- Home /
Editor Extension (Level Editor)
Hi there i was just wandering how exactly i can get all objects from a folder and stor them in an array so that i can search for types and what not?
I was trying things like models = AssetDatabase.LoadAllAssetsAtPath("Medieval Village");
where models is an Object[]?
Answer by whydoidoit · Sep 24, 2012 at 10:47 AM
An asset can contain more than one thing which is why that code returns an array but only opens a single thing. Resources.LoadAll works for a folder but only in the resources directory, Resources.FindObjectsOfTypeAll is useful as it will search prefabs but not using a path.
Answer by Bunny83 · Sep 24, 2012 at 10:56 AM
In the editor you can use the usual `System.IO` functions to search for content in a folder. Now you can filter it manually (by extension / file name / what ever) and use AssetDatabase.LoadAssetAtPath on each asset you want to import.