• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by adam michaels · Jan 03, 2010 at 09:01 PM · mono

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

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
12
Best Answer

Answer by AngryAnt · Jan 04, 2010 at 09:59 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
10

Answer by Lucas Meijer 1 · Jan 04, 2010 at 12:00 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by duck · Jan 03, 2010 at 09:28 PM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · Oct 20, 2017 at 10:09 PM 0
Share

Yeah you are right. I thought that... I am sorry for my bad English!

avatar image
-1

Answer by $$anonymous$$ · Oct 20, 2017 at 04:39 PM

Wow why do you ask that?

OPS: Sorry for old threads ... I know because Unity 3D was written in C# Yes Why I recognized since Net Frameworks 4.6 If I forget to install before. I thought Unity 3D was embedded by mkbundle and cl Hahahaaaaaaa! I caught that. And Unity Editor looks common like without "Apply", "Cancel" and "OK" That is why it was written by C# / Mono = CORRECT! Because I have checked UnityEngine.dll and UnityEditor.dll in ILSpy that is why all are written in C# / Mono!!!!

You know it is 2. successor "WaveEngine" = / = "UnityEngine"

Now we have 2 different Game Engine written by C# / Mono. I have downloaded WaveEditor it is really cool so like Unity 3D with C# script.

That is why It is correct. No only C++/+

But Unity 3D's Editor was embedded by mkbundle and cl with mono-2.0-sgen.dll and mono-2.0-boehm.dll I will check if Editor of Unity 3D has 2 requiered dlls or did you embed with BoxedApp Packer or Enigma Protector? :P Ahaaaaa I see that ILSpy says Editor.exe has not managed assembly - I know that is correct if developer has both dlls of /MONO_INSTALLDIR/bin into own executable. Am I right?

Sorry for my bad English

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Oct 20, 2017 at 09:24 PM 1
Share

Sorry but you have no idea what you're talking about. Unity is written in C++. Unity only uses C# / $$anonymous$$ono as scripting environment. The UnityEngine and UnityEditor dlls are mainly managed wrapper DLLs which represent the API to the actual native engine code.

Unity actually exists since 2005. However that "WaveEngine" you talk about was born in 2011

Finally the Unity Editor doesn't use any default UI framework but uses a seperate device context for every window and the UI is drawn with their own I$$anonymous$$GUI system. btw: "Lucas $$anonymous$$eijer" works for UnityTechnologies so you might want to actually read what he has written above...

avatar image Reynarz Bunny83 · Oct 21, 2017 at 12:42 AM 0
Share

$$anonymous$$mm for that reason i can't dig more in the UnityEngine.dll using iLspy. And i can see two painful attributes.

 [WrapperlessIcall]
 [$$anonymous$$ethodImpl($$anonymous$$ethodImplOptions.InternalCall)]
avatar image Bunny83 Reynarz · Oct 21, 2017 at 01:41 AM 0
Share

Those two attributes are not the "bad" words but the little keyword "extern". Pretty much everything is actually defined external. Just have a look at Transform.position for example. In the end 90% of all methods and properties are just external declared methods.

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Can Unity Iphone game be written in C#? 4 Answers

Is it possible to upgrade the included version of Mono manually? 1 Answer

Integration with DarkStar/RedDwarf? 1 Answer

Mono Runtimes Not Detected After Install 2 Answers

sqlite plugin anomalies on ios 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges