- Home /
Can MonoBehaviours be partitioned into different assetBundles?
It seems that all my code gets compiled into a single DLL which is included in the root Unity3D file, and that only art assets can be partitioned. Is there a way to target specific MonoBehaviours to go with specific files to delay loading them until their scene is loaded?
Answer by Lucas Meijer 1 · Jan 07, 2010 at 12:15 AM
Not easily. If you keep your code "away from unity", in a seperate dll, you can download that with the WWW class, and use something like Assembly.LoadFromBytes() to load it in.
however, that's defenitely swimming upstream. While the ability to spread monobehaviours over different assetbundle would be nice, filesize and loading time is usually not a great concern, as cmopiled code tends to be a lot smaller than your assets most of the time.
Size isn't a concern; we're trying to define a 3rd-party plugin API for our game.
Answer by Gunder · Jan 07, 2010 at 01:14 PM
I think Assembly.Load not be used to 'export' Assembly MonoBehaviours because each uses its own namespace, so you can not load a class that derives from MonoBehaviours from the dll to be used as a component. I wish there was a solution.
Perhaps one could define an IGamePlugin interface for separate DLLs to use and then have a GamePluginHost $$anonymous$$onoBehaviour which forwards the necessary callbacks?
Your answer
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
Is it sensible to build an assetbundle for each texture/mesh? 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Copy the file from assets and paste it out side the assets folder 0 Answers
Storing a part of a complex asset in an asset bundle 1 Answer