Unfortunately, no answers here or on the forum.
The closest I've come to making script references resolve is by using plugins. U5 makes it pretty easy to code a script in an external (VS or Mono) project and load the assembly in the editor as a managed plugin. As such, all scripts contained within the plugin can be instantiated and edited in the editor as if they had been compiled by the editor.
If a scene bundle uses a script within the plugin, all the bundle loader (in a different project) need do is load the plugin (Assembly) dynamically first, and references in the scene bundle seem to resolve.
I need to test more, but this seems the closest way possible towards letting content developers use the Unity editor to export assets and scripts as a complete package.
It's unfortunate that setting up and editing the plugin project is a bit cumbersome for a non-programmer. It would be nice if the editor could be told to compile and export scripts as a managed plugin (rather than putting them in Assembly-CSharp) with a name of my choosing (similar to the way asset bundles are created). I've requested the feature on the feedback forum. Others have suggested the same, though for differing reasons.
http://feedback.unity3d.com/suggestions/export-compiled-scripts-for-asset-bundles-as-plugin-custom-assembly
If anyone can figure out an editor script to do it, please provide.
Thanks.
↧