
Select Build AssetBundle from the Assets menu. Select the Asset or Assets in your project folder that you wish to make into an AssetBundle. Create a C# script file named ExportAssetBundles.cs, inside an folder named Editor, in the Project View. This previous example will create a new item in the “Assets” menu of your editor called “Build AssetBundle”. More info See in Glossary, it is instead used by the Editor. A GameObject’s functionality is defined by the Components attached to it. | BuildAssetBundleOptions.CompleteAssets) Īn Editor script does not need to be applied to a GameObject The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. Object selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets) īuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path,īuildAssetBundleOptions.CollectDependencies
String path = "Assets/myAssetBundle.unit圓d" Here is an example of such a script in C#: // Legacy Unity 4 example. All scripts using Editor classes must be placed in a folder named Editor, anywhere in the Assets folder. To create an Asset Bundle you need to use the BuildPipeline editor class. This information is provided for those working on legacy projects in Unity 4, and speaks assuming you are using Unity 4. (In Unity 5 we provide tools in the editor to assign assets to specific Bundles).
In versions of Unity earlier than Unity 5, assets had to be selected and added to bundles using editor scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like.