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(); go.AddComponent(type);
}</file>
- 출처: 유니티코리아위키 (CC BY-NC-SA 2.0)