Notifications
Article
Building DLL library with MonoDevelop on MacOS
Updated 4 months ago
27
0
If you write unity plugins and don't want to share your code...

Step 1. Create project

Open MonoDevelop and create a new Library project.




Step 2.

Enter the project name and choose a location path.





Step 3. Rename

MyClass.cs will automatically be created. You can rename it, just set cursor to class name (line 5) and press cmd + R




Step 4. Write code

Write your code and try to build (cmd+B). If you use UnityEditor, UnityEngine and etc. standard libraries, you will receive references error.




Step 5. Add references

Right click on References folder and select Edit references...
In opened window select .Net Assembly and press Browse...



You can find unity libraries in Unity application folder.






Step 6. Options

It allows use your library in unity
Right click on Project folder and select Options
In opened window select Build -> General and change target framework to Mono / .Net 2.0


Step 7. Build

Build your project again






.. and find DLL file in project's folder




Step 8. Use library

Import your namespace and use your library. Good luck!

Arkadiy Tsoy
Developer - Programmer
1
Comments