- Home /
AssetBundle: Prefab+ScriptComponent
Hello, Community!
I build AssetBundle which contains SimplePrefab using BuildPipeline.BuildAssetBundle(Selection.activeObject, null, path, BuildAssetBundleOptions.CompleteAssets)
;:
When I try to load it in the other project, I get this prefab with good image (SpriteRenderer), but this script "Application" can not be loaded:
If anybody can advice me something, I'll be very gratefull!
What is that script Application, you put it there? Unity already has a class Application in UnityEngine namespace. $$anonymous$$aybe that is the error. Try rena$$anonymous$$g the class or put it in a namespace. And put a screen with the Console errors too.
Renamed, the result is the same. Console have no errors. Script is with one method Update()
.
I suggest: may be it is not possible to load correctly prefab with attached User's scripts (components)?
Answer by melwei · Mar 16, 2015 at 02:46 PM
I think you have to clone the Script "Application" into the other project. Maybe you also have to add the component again. Else it checks if theres a script with name "Application" in the Asset Folder - but there is none.
Thanks, I tried to copy Application to the Asset Folder and added the component again. It works:) And I'm still looking for better solution or looking for evidence of the impossibility of better solutions:)