1
votes

So I have a gameObject(Let's call it XX) and I have created a Prefab of XX that contains a script (the XX prefab has a script component). When I build the AssetBundle and I load XX on a button click the gameObject of XX loads correctly but the script component doesn't come along. Is there a way to load XX with the script component? Thanks!

1
Taking a look at AssetBundle it is platform-specific non-code Assets. This might help: forum.unity.com/threads/… - nka_Zz

1 Answers

0
votes

The Solution to my question is that you create the asset bundle from your model-object and then through code you AddComponent to this. Something like this: MyClass xx = anObject.AddComponent(typeof(MyClass)) as MyClass;