Problem withLoadAssetAtPath

Hi there,

I’m trying to use Resources.LoadAssetAtPath and AssetDatabase.LoadAssetAtPath in an editor static function to use in batch mode. But it seems no one works.
My code is this :

static function Export(){
var go : AudioClip[];
go[0] = Resources.LoadAssetAtPath("/assets/sounds/1.mp3",AudioClip);
Debug.Log(go[0]);
.
.
.
}

It works when I put it for example in Start function.

Is it a bug? and what can I do?

Can you clarify exactly what goes wrong? Do you get a null object from the LoadAssetAtPath call, error message… ?

Yes, it’s a null object error. But when unity is in play mode, everything works;

guess this is an iphone project then?

Because on the desktop it would just fail due to the fact that mp3 is not supported at all for playback. Audio is converted to ogg for compressed and otherwise is wav.

No, it’s desktop. It takes the path to original asset, but uses the converted one.