Including scripts in AssetBundles

AssetBundles can c

  AssetBundle bundle = www.assetBundle;
  // Load the TextAsset object
  TextAsset txt = bundle.Load("myBinaryAsText", typeof(TextAsset)) as TextAsset;
  // Load the assembly and get a type (class) from it
  var assembly = System.Reflection.Assembly.Load(txt.bytes);
  var type = assembly.GetType("MyClassDerivedFromMonoBehaviour");
  // Instantiate a GameObject and add a component with the loaded class
  GameObject go = new GameObject();


back to AssetBundles Intro