Unity 3.1 new feature: move any code into a DLL [Case #382505]

Following discussion in the Gossip forum, I created a small test project (attached below) to see if custom editors and editor windows could be made to work when bundled in a .NET assembly (DLL). Here is what I found:

  • A MonoBehaviour component can be included in a DLL
  • A MonoBehaviour component in a DLL can be created via GameObject.AddComponent()
  • GameObject.AddComponent() can be called from a class in a DLL
  • Unity is not able to instantiate a custom editor from a DLL (“no script with that name”)
  • Unity is not able to instantiate an editor window from a DLL (“no script with that name”)
  • Unity is able to load/execute code from a DLL linked with UnityEditor.dll, though

This seems inconsistent with the 3.1 release note claim that any code may now by migrated into a DLL. It’s possible that I have missed a required step in configuring/compiling/deploying the DLLs, but the error messages received within Unity (the dreaded “no script with that name” error) is consistent with the prior behaviour.

I’ve submitted this as a bug, Case 382505, and linked this support thread from the original Gossip forum discussion. Any feedback, either from Unity or another member of the community that has got this working, would be much appreciated.

Thanks for spotting this. It’s possible that this was never intended to work with editor scripts but if so then this should be made clear in the docs.

If the behaviour is as intended, the wording in the release notes is a bit mis-leading :wink: Hopefully this can be ‘fixed’ rather than just documented, but clarification/confirmation either way would be great. Thanks Andeeee.

Yes. I think that this should be fixed rather than just documented. For now, the asset store is open. One will want to share his extension in DLL form obfuscated. So it will protect the work for developers. Looking forward to seeing it fixed rather than just documented.

Yes, please fix this.