Curious how to add new enemy scripting/behavior in on-demand asset bundles

I’m planning to do in app purchase of new game levels/scenes.
So i’m reading up on https://bitbucket.org/Unity-Technologies/assetbundledemo

So assets are data files, images, sound; no executables like c#.

How do you introduce new enemies that require new scripts in the new levels?

You can’t add a new script to an asset bundle that isn’t in the project. So, let’s say I want to introduce a troll enemy and I create a troll script. The troll script is brand new but doesn’t exist in the project that the players are currently playing. Releasing the troll enemy will not work as they don’t have the troll script.

You would have to update the project to have the troll script in it, then you could release the troll enemy, since the project would have the troll script now in it.

Now, there is a way around this, but note the limitations as listed here Unity - Manual: Including scripts in AssetBundles

I see. So it’s easier to just update the app and unlock the level on purchase.

Or define your enemy behavior in a higher level scripting language like Lua that you interpret at runtime. You can include Lua scripts as text asset files in your assetbundles.