- Home /
Accessing the Asset's setting from code using Wizards/Editor classes?
Hey, I'm trying to get/set values and settings from an asset that is visible in the Projects Window. I'm trying to create a menu/wizard that will set/get values from a group of assets. I know how to do it for objects that are in the scene already, but How would I do it directly to the assets? Sorry if I'm not being specific enough. Thanks.
EDIT: I was looking around and it looks like I'll have to use the AssetDatabase to return all the assets, but how would I go about doing that? I tried AssetDatabase.LoadAllAssetsAtPath("/"); but it returned nothing. Any help would be appreciated. Thanks.
You can use System.IO methods (Directory.GetFiles/GetDirectories) to browse Application.dataPath, and then use AssetDatabase.LoadAssetAtPath to load each asset. This will give you Importer objects (TextureImporter, etc.) whose properties you can change.