Missing textures in on a generated prefab/mesh

Hi all,

I am having some issues with my generated mesh.

I have a procedure that generate mesh in the editor, and I save the generated mesh as .asset in a folder, plus I create a prefab containing the generated mesh with some script, material and settings on it.
For this I use AssetDatabase.CreateAsset() and PrefabUtility.CreatePrefab().

Everything is registered in my Resources folder. And on the prefab I use material and texture that are inside Resources too.

When I play in editor everything works great but when I build, the generated mesh is missing material/texture. Should I load the material dynamically ? How could I create a static link to the material ?

Thanks!

My bad, actually I already assigned a material dynamically and I use a specific shader that it is not used anywhere else.

So I just move this shader to Resources folder to be sure to have it anyhow and that’s it :o)