x


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.

more ▼

asked Feb 21 '11 at 07:45 PM

kennypu gravatar image

kennypu
677 12 12 24

You can use http://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.

Feb 22 '11 at 06:33 AM yoyo
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3688
x386
x280
x14

asked: Feb 21 '11 at 07:45 PM

Seen: 1073 times

Last Updated: Feb 21 '11 at 08:17 PM