Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

AssetBundles and external files


If you’re using Unity Pro and want to offer dynamic content to users, allowing gamers to modify (mod) game content, add their own assets, and add-ons, as well as support your own add-ons and plugins, then AssetBundles can be useful. AssetBundles let you package together many disparate Unity assets into a single, external file outside the main project, which can be loaded into any Unity project dynamically, either from a local file on disk or via the Internet:

Building AssetBundles from selected assets

To get started, import the Unity asset bundle editor script to build AssetBundles easily from the Project panel. To do this, paste the following code sample 10-2 into a C# script file located inside an Editor folder in your project; otherwise, you can download the script from: http://docs.unity3d.com/ScriptReference/BuildPipeline.BuildAssetBundle.html:

  // C# Example
  // Builds an asset bundle from the selected objects in the
  // project view.
  // Once compiled...