Asif
Asif

Reputation: 21

Use c++ Code in Unity3D

I am using unity3D for the first time to develop a game.I have written a code in c++ using Opencv and the code consist on many files.Now I want to apply the result computed by c++ code to a 3D character. How i can use my c++ code in unity.Please help me.Remember I am using OpenCV Libraries in my c++ Code.

Thanks!!

Upvotes: 1

Views: 308

Answers (2)

marsh
marsh

Reputation: 2720

You need to write a DLL file and use it within Unity. There is many examples on how to do so.

http://docs.unity3d.com/Manual/Plugins.html

If you have some money you can also purchase the Unity source code that is written in c++ though that seems a bit overkill.

Upvotes: 2

Lefty
Lefty

Reputation: 426

did some googlefu...

C++ is not a scripting language, and can only be used with Unity in the form of plug-ins (in the Pro version). C# is closer in syntax to C++ than Javascript is.

http://answers.unity3d.com/questions/12809/can-i-use-c-as-a-scripting-lanques-for-unity.html (couldn't find anything that contradicted that)

although these might be of interest: https://gamedev.stackexchange.com/questions/82518/is-it-possible-to-use-c-with-unity-instead-of-c http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/

Upvotes: 0

Related Questions