I’m probably missing something blindingly obvious here, but how do i include classes from a custom .dll file into my scripts in Unity?
Do i put the .dll in a particular directory? Or can i link it in my project?
T
I’m probably missing something blindingly obvious here, but how do i include classes from a custom .dll file into my scripts in Unity?
Do i put the .dll in a particular directory? Or can i link it in my project?
T
ok, so i’ll answer my own question for anyone else who wants to find out how to do something so simple.
you need to drop the custom .dll file into the ‘assets’ folder of the project you want to include it in - you’ll see it appear in the assets view in Unity and the namespace can be included in your project’s scripts…
that only works for .NET DLLs (ie assemblies)
plugin dlls must be in the plugin folder, you need to write DLLImport Code and you must have Unity Pro for that
so for example you make a dll using visual c++ or visual c#, compile it and use it in Unity? (like a dll that calculate stats for an rpg and returns values?)
I was thinking that only Unity Pro can use dll…
You can build .net code into a .dll, but its still a .net bytecode assembly for JIT’ing. This can be used in unity indie and basic. Furthermore .net assemblies can be included in webplayer builds.
A regular .dll file is a binary file and can only be included in unity pro and advanced (future feature). Binary .dll’s cannot be included in webplayer builds.
Thanks for the explanation…never knew that what i do in VC6 as DLL (pre .net)is different from what i do with visual C# .NET(know about the just in time compiling, but never went too deep in the architecture :P)
Now i know