Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am interested in using utilising third-party libraries in Unity Free.

I know Unity can use managed libraries as assets, but only the Pro version supports using native libraries (DllImport within scripts). This thread, however suggests that it is possible to import DLLs in the free version.

I would like to utilise native libraries (as a hobbyist I cannot afford the Pro version), but want to do it the supported way so I don't have to worry about Unity 'fixing' this hole if that is what it is.

Is there any supported way to use native libraries with Unity free (in other words, is the method described in that thread using DllImport safe and reliable, or is it a workaround that might be patched away)?

share|improve this question
    
You could consider using a managed C++ dll to communicate between the two if unity doesn't support native C++ in their free distribution. –  Evan Mar 5 '13 at 23:29
    
Late reply.. but why not try it yourself? You can build your .exe with Unity free and have it load your native code DLL fine. Unity Pro only seems to restrict plugins when they reside in the Asset/Plugins. This work around isn't ideal, but could do the trick. –  Fabien Jun 26 '13 at 16:30
    
@Fabien, I definitely would to see if it worked - actually from what I have read I am pretty sure it would work - but theme of the question was meant to be more... is it going to work in 2 years time when Unity XYZ is released. :) –  sebf Jun 30 '13 at 18:55
add comment

1 Answer

You can use DllImport in compiled managed DLLs which are referenced in your C# code.

However you will not be able to use your resulting product on any system other than windows.

For additional information see this thread.

share|improve this answer
1  
This answer would be much better if you included an example of how to do so, even if its from your linked thread, as external links are subject to link-rot and that content eventually may become unavailable. –  Josh Petrie Dec 20 '13 at 16:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.