x


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 '10 at 09:01 PM

adam michaels gravatar image

adam michaels
753 22 26 31

(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 '10 at 09:59 AM

AngryAnt gravatar image

AngryAnt ♦♦
4.4k 14 19 52

(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 '10 at 12:00 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8.7k 21 47 88

(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 '10 at 09:28 PM

duck gravatar image

duck ♦♦
45.8k 110 164 426

(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

By RSS:

Answers

Answers and Comments

Topics:

x231

asked: Jan 03 '10 at 09:01 PM

Seen: 22733 times

Last Updated: Jan 03 '10 at 09:01 PM