1. What is .NET
.NET is a developer platform built by Microsoft, mainly including:
1. Support (for) programming languages (such as C#, Visual Basic, C++/CLI, F#, IronPython, IronRuby...),
2. Technical framework system (.NET Framework, .NET Core, Mono, UWP, etc.) used by developers under this platform,
- 1. Define a general type system and a huge CTS system
- 2. Environment used to support language runtime under .NET: CLR
- 3..NET system technology framework library FCL
- 3. Software tools used to support developers' development (i.e. SDKs, such as VS2017, VS Code, etc.)
2. What is Mono
Microsoft's .NET framework itself can only run on Windows, and Mono is born for cross-platform needs.
- Mono is an open source cross-platform tool for .NET that can be operated cross-platform.
- Mono is an important supplement to the .NET framework on different platforms, and Mono is also cited by Unity.
3. How Unity implements cross-platform
Because Unity uses a code instruction set called CIL (generic intermediate language). CIL can run in any environment that supports CLI (universal language infrastructure).
The compilation of Unity code is divided into two parts:
- Compilation from code to CIL
- Instant compilation of runtime from CIL to local instructions (not including IOS, because IOS cannot use the JIT engine)
When Unity is packaged, mono will be packaged together. At the same time, Unity compiles the script into CIL code to package it. In this way, as long as it is a platform supported by Mono, it can be compiled into platform-local code in Mono.
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.