- Home /
Unity integration options
Dear Unity community,
I am a complete newcomer to Unity, considering using it for a project or not, and I have a few questions of interoperability.
Can I call existing C++ code (for desktop deployment) ? I understand that Unity is a Mono/.Net environment, so doing PInvoke should be straighfoward, but the documentation seems to imply that a Pro version is needed.
Is the Mono environment somehow "blocked" in some of its functionalities ?Can I create an executable that does not show any window ?
Think an application that reads a text file and creates a video out of it. The rendering of the video would be done via Unity, but no need to show it in a window.Can I call Unity code from C++ ?
Again, being based on mono / .Net it should be not a problem, but being a closed source product, maybe this is not possible. How would that work ?
Thanks for your answers.
Unity uses either c# or javascript, whichever you prefer. c++ is not that different from c#, so porting would not be hard. As for your questions, I'll let someone more experiences answer, as frankly, I'm not even sure what it is you're asking at some of these points.
Porting existing code base to c# is not an option in our scenario. Thanks for the feedback, but if you cannot understand the questions, providing a meaningful answer is difficult indeed.
Well regardless of the other points, I'm telling you outright, you can't code in unity with c++. Its either c#, javascript or boo (whatever the hell THAT is).
Are you refering to point 1 or 3 ? Point 1 is doable, just unclear if from Pro version only or not. Point 3 is not about coding unity functions in C++, but rather calling unity as an engine from C++. Think having C++ that calls "now run the following unity program" (but without creating a new process).
Ok, now I understand a bit more what it is you're trying to do. Its quite a few rungs above the usual questions you see on unity answers. You should probably try ant contact unity staff directly, to find out if such things are possible. Particularly point 3.
Answer by Graham-Dunnett · Jul 08, 2013 at 08:39 PM
Unity has a feature called "plugins" which allows script code to call into native DLLs.
No.
No.
I thought I would add something to your answer, namely that the documentation you linked above describes "plugins" as a Pro-only feature, but also goes into detail about your standard PInvoke stuff for using native libraries in managed code. The documentation could be confusing, as there doesn't seem to be any restriction on the latter as opposed to calling a DLL that uses the Unity plugin API.