(Sorry if this is the wrong forum, wasn’t sure which one it should go in)
I’ve made a game recently with some characters and people are asking for “expansion packs” with different characters. Is there a good way to do this with unity?
What I would like:
File 1: My Unity Game.
File 2: My expansion pack with characters in it.
Basically is there a way, if you have two unity games, to import characters from one into the other? I think you could do this sort of thing in Flash by importing one Flash movie inside another for example when making loading screens in a separate swf file.
(I’m certain the answer is “no”. But it would be great if the game engine had this functionality!)
If you are designing this from the start, use an asset bundle. It does exactly this.
Otherwise build a version of your game that does support asset bundles, have the user manually download and install the new version. Then use an asset bundle.
Wow! I was not aware of that!
So what kind of things can an asset bundle contain?
What about prefabs with components and scripts attached?
What about entire scenes? (Or an entire game?)
What I would quite like to do is have an expansion pack with new characters and possibly new levels. Or maybe just new versions of the old characters with different clothes.
Scripts are tricky. By default they don’t work in asset bundles. But on some platforms you can set up to load them dynamically at runtime. Its complex, but possible. On other platforms (most notably iOS), you can’t do anything even resembling adding code at run time.
When you’re releasing expansion, you can release patch for main game containing expansion scripts which aren’t active or used by default, and do not include assets it requires(and, possibly, fixes for original game at same time). If user buys expansion, you download asset bundle and scripts detect user now has extension and extension scripts activate.
Otherwise, only dynamic assembly loading as BoredMormon said (afaik only iOS doesn’t support it).
Yep, that was what I was thinking of doing. Updating the man game once. And then I am able to create lots of different characters as expansion packs. I know in Flash you could import a whole Flash game inside another Flash game. I don’t think you could do that in Unity right?