Hi
I have a mesh as main Asset of assetBundle and can load it as mainAsset but I can’t get that mesh through Load function by “name”.
Is it impossible?
Thank You.
Hi
I have a mesh as main Asset of assetBundle and can load it as mainAsset but I can’t get that mesh through Load function by “name”.
Is it impossible?
Thank You.
sure… AssetBundle.Load(“itemname”);
It not works for me… i’ve got Missing Mesh in “mesh slot” and no errors about.
print("name: " + database.assetBundle.mainAsset.name);
print("type: " + typeof(database.assetBundle.mainAsset));
// prints name: radar_0 ans type: UnityEngine.Mesh
meshTurret = database.assetBundle.mainAsset; // works fine
// meshTurret = database.assetBundle.Load("radar_0",Mesh); // mesh == null
if( meshTurret ) print("vertex count: " + meshTurret.vertexCount);
else print("you fail with your stupid turret again");
If the main asset is not a prefab, I can’t load asset by name, but as a mainAsset can.
If the assets are not a prefabs, I don’t know how to load them.
Looks little confusing.
Very old post, but how did you resolve this issue? I struggle in loading AssetBundles with .fbx models. I have 3-5 .fbx in each AssetBundle and when i load them both mesh and materials are missing.
Unless you explicitly remove file prefixes when building bundle perhaps you need them.
I’m loading arbitrary asset types just fine via the full bundle path
‘assets/textures/test.jpg’ etc