How save assets as fbx in Unity3d?

I generate model buildings dynamic in Unity3d. After generated I have many count of Meshes in Scene. How save its in fbx?

You simply can’t without a third party library. The Unity engine can’t handle fbx files at all. Only the Unity editor has an FBX file importer. It can’t create FBX files. Unity is not a modelling tool.

As @das4898 said you can use AssetDatabase.CreateAsset to store the mesh / gameobject into an file in Unitys asset file format. When Unity “imports” an fbx file it also get converted to that format. The main asset is a gameobject while they add the Mesh asset as subasset. The subassets can be seen when you “expand” the asset in Unity.

Since 2005 the FBX SDK is free, however it’s a C++ library. It will help in the process to convert a whole gameobject with meshes into an FBX, but you have to write the exporter yourself.

Things created inside the Unity editor are best saved as assets in Unity. If you want to create things for usage outside of Unity, that’s not possible. You would have to export the data yourself. Again: Unity is a game engine and the Unity editor is a game authoring tool. It’s not ment to actually create assets.

@utyasheva.irina
Your question is not very clear. If you meant to ask, how to save dynamically created prefabs into the disk, you might want to see AssetDatabase.CreateAsset() method.

Hope it helps. Comment in the thread, if your issue is different.