- Home /
How do you put stuff in assemblies?
With 3.0+ apparently we can put stuff in assemblies, even with Indie:
"Managed .NET DLLs can now be placed in the project folder and can contain script code, including MonoBehaviours, EditorWindows and ScriptableObjects. This allows you to move any code into a DLL, making code sharing between projects easier, and making it easier for middleware developers to create libraries without sharing the source code. This was introduced in Unity 3.0 but was not mentioned in the release notes."
a) what (else) can go in those DLL's? Can gameobjects, prefabs, components, etc. go there?
b) how do you create such things? Is this something that is produced by Unity or do you use Visual Studio.
c) are there any docs anywhere about this process?
Answer by Mike 3 · Mar 18, 2011 at 04:52 AM
a) Only code can go in them
b) Visual studio, monodevelop, or using the mono compiler manually. Generally you just set up a c#library project, add in the code and link the correct dlls, then compile
c) Pretty much everywhere on the internet, it's not unity based whatsoever. Generally look up how to build c#library projects in your IDE of choice, and make sure the .NET framework is set to 3.5 or below
Thanks! A question on code: Is it just generic C# .NET stuff, or can I call Unity API's? Could I, for example, programatically create a GameObject, add a $$anonymous$$esh component, etc. in such a DLL?
You can do all of that yeah, as long as you link in UnityEngine.dll (and UnityEditor.dll for editor stuff), and Boo.Lang.dll too I believe