Is Unity Engine written in Mono/C#? or C++

Is the core Unity Engine itself written in C++ or C#/Mono-based code?

more ▼

asked Jan 03, 2010 at 09:01 PM

avatar image

adam michaels
858 49 46 56

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

The Unity runtime is written in C/C++. This runtime is used in any build you create using the editor - for webplayers and plugins it is installed separate from your build, whereas it is included in it for stand-alones and other platforms such as iPhone and Wii.

The editor is built on the Unity runtime and additionally includes editor-specific C/C++ binaries.

Wrapped around the Unity core is a layer which allows for .net access to core functionality. This layer is used for user scripting and for most of the editor UI.

more ▼

answered Jan 04, 2010 at 09:59 AM

avatar image

AngryAnt ♦♦
4.5k 21 31 88

(comments are locked)
10|3000 characters needed characters left

Unity is written in C++, with the following exceptions:

  • we expose a .NET api so that you don't have to go trough the pain of writing your game in c++, but you can write it in Javascript or c# or boo.

  • The editor application's UI is written in C#, using mostly the same API that we expose to game developers. (We have access to a few API's that we don't expose (yet), but not that many)

This is also the reason that the answer to the question "Can I use UnityEngine.dll in some other c# project" is always no. There is hardly any functionality in UnityEngine.dll, the only thing it does is relay your c#/javascript calls into the C++ part of Unity. Without the C++ part there is nothing.

more ▼

answered Jan 04, 2010 at 12:00 PM

avatar image

Lucas Meijer 1 ♦♦
9.2k 33 96 139

(comments are locked)
10|3000 characters needed characters left

This can definitely be answered in more detail by one of the UT engineers, but as far as I know, it's a mixture of both. Certainly a lot of the core code is in c++, including the physics engine and sound engine, however as far as I understand, much (if not all) of the Editor UI itself, including the terrain engine and its editing tools, is written in c# using Unity's own editor scripting.

more ▼

answered Jan 03, 2010 at 09:28 PM

avatar image

duck ♦♦
49.5k 142 350 539

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Jan 03, 2010 at 09:01 PM

Seen: 29915 times

Last Updated: Jan 03, 2010 at 09:01 PM