Strahinja
Strahinja

Reputation: 460

Does Unity compile scripts to c++?

Does Unity compile C# scripts to C++?
And generally how does running games in Unity work?

Upvotes: 3

Views: 4188

Answers (1)

Ludovic Feltz
Ludovic Feltz

Reputation: 11916

I see a lot of comment here that are totally WRONG. The answer is YES, you can convert C# code to C++ as an alternative to Mono if you are using IL2CPP. (if you choose to in player params)

When building a project using IL2CPP, Unity converts IL code from scripts and assemblies to C++, before creating a native binary file (.exe, apk, .xap, for example) for your chosen platform. Some of the uses for IL2CPP include increasing the performance, security, and platform compatibility of your Unity projects.

You can see this blog post on the Unity website about how it works.

Or the documentation for more informations on the subject

Upvotes: 9

Related Questions