Provoked by a question by a team member (Magnus) I really could find any good arguments.
The case is, that I’m coding a .net dll using C#, and he had the insane guts to ask the same question to me as I’m now posting here:
“Why code a dll in C# if you can code C# inside Unity as script?”
Only arguments I could come up with are:
easier to version control plugins vs. loose script files
a (not very good) way to keep source code hidden
more generally usable as dll (for other types of clients) than Unity script
But are there really no other arguments? Can I do more in C# as a dll than from script? (Could be that the implementation in Unity is limited to something)
Nope, a standard .Net DLL is simply just a way to keep all the code together. That is a gross simplification, but you get the point.
My own personal opinion is that it is best to set it up with the raw scripts in Unity while you are developing it and testing, then once it’s stable, then move it to a DLL. This way you are not going back and forth between making a change, building the DLL, running it in Unity, finding out that you forgot a semi-colon, going back…etc.
Standard .Net DLLs are useful for reusing code, as you said, but there isn’t really anything else to them.
Edit: if you do Unit testing, that is nicer if your code is packaged in a DLL however, and versioning isn’t really easier with a DLL as you have to version the source files, but I think I understand what you meant.