x


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?

more ▼

asked Jan 06 '10 at 09:29 PM

Max Kaufmann gravatar image

Max Kaufmann
573 10 12 21

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Jan 07 '10 at 12:15 AM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8k 19 43 85

Size isn't a concern; we're trying to define a 3rd-party plugin API for our game.

Jan 07 '10 at 08:06 PM Max Kaufmann
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jan 07 '10 at 01:14 PM

Gunder gravatar image

Gunder
288 11 13 27

Perhaps one could define an IGamePlugin interface for separate DLLs to use and then have a GamePluginHost MonoBehaviour which forwards the necessary callbacks?

Jan 07 '10 at 08:05 PM Max Kaufmann
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5076
x419
x382

asked: Jan 06 '10 at 09:29 PM

Seen: 1001 times

Last Updated: Jan 07 '10 at 02:38 PM