Saturday, April 25, 2015

Is it possible to use C++ with Unity instead of C#?


The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity?



Answer



It is possible to use C++ with the Free version of Unity, although it is easier to work with if you have a Unity Pro license. All you have to do is wrap it up in a DLL and follow the instructions below on where to place it.


I wrote an article that covers this topic: Unity and DLLs: C# (managed) and C++ (unmanaged)



For Unity 4 Free:




  • Add unmanaged code to the Unity Project Root: UnityProject

  • Add managed code to the Plugins folder: UnityProject->Plugins

  • When you build a project, copy the unmanaged code to BuildRoot->Data->Plugins


For Unity 4 Pro and any Unity 5:



  • Just copy the DLLs into UnityProject->Plugins




Unmanaged means C++ and Managed means C#


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...