Compile c# files

Hi there! Quick question… How do I compile c# scripts to dll files that run within the Unity workspace?

If I were to compile such files, would they have access to the UnityEngine class’s?

You need to compile them to a .NET assembly. You can do that with Visual Studio / MonoDevelop, or with the .NET command-line tools. Once you’ve created the assembly DLL, you just need to drag it into your project (anywhere in the Assets folder). And yes, you can compile against the Unity APIs; just include the appropriate assembly references.

Thanks, laurie! :slight_smile: You’re the best. :smile:

Special Note: while most of what was said by Laurie is correct, however you want to compile via Mono and not as a .NET assembly. They are occasionally interchangable, however they are also frequently not and will load with errors. Mono is similar to .NET only it is an external project replicating .NET and CIL on systems other than Windows.