Using .NET API 2.0 compatibility level
Manual     Reference     Scripting   
Unity Manual > Getting Started with Android Development > Android Scripting > Using .NET API 2.0 compatibility level

Using .NET API 2.0 compatibility level

iOS

Now Unity iOS supports two .NET API compatibility levels: .NET 2.0 and a subset of .NET 2.0 You can select the appropriate level in PlayerSettings.

.NET API 2.0

Unity for iPhone/iPad targets supports the .NET 2.0 API profile; It is close to the full .NET 2.0 API and offers best compatibility with pre-existing .NET code.

Pros:

  1. Better code compatibility with desktop Unity and third party libraries
  2. More features in standard the API set

Cons:

  1. Application build size is bigger
  2. Slightly worse application startup time

Note: Unity iOS does not support namespaces in the scripts. If you have third party library with the source, then the best practice is to compile this library outside Unity iOS Editor and drop library .dll file into Assets folder.

.NET 2.0 Subset

Unity iOS targets also support the .NET 2.0 Subset API profile. It is closest to the Mono "monotouch" profile, so many limitations that are applicable to the "monotouch" profile are also applicable for Unity iOS implementation of this .NET profile. More information on "monotouch" profile limitations can be found here.

Pros:

  1. Smaller application distribution size especially when stripping is not used

Cons:

  1. Worse compatibility with standard and third party libraries

Android

Unity Android supports two .NET API compatibility levels: .NET 2.0 and a subset of .NET 2.0 You can select the appropriate level in PlayerSettings.

.NET API 2.0

Unity Android targets supports the .NET 2.0 API profile; It is close to the full .NET 2.0 API and offers best compatibility with pre-existing .NET code.

Pros:

  1. Better code compatibility with desktop Unity and third party libraries
  2. More features in standard the API set

Cons:

  1. Application build size is bigger
  2. Slightly worse application startup time

Note: Unity Android does not support namespaces in the scripts. If you have third party library with the source, then the best practice is to compile this library outside Unity Android Editor and drop library .dll file into Assets folder.

.NET 2.0 Subset

Unity Android targets also support the .NET 2.0 Subset API profile. It is closest to the Mono "monotouch" profile, so many limitations that are applicable to the "monotouch" profile are also applicable for Unity Android implementation of this .NET profile. More information on "monotouch" profile limitations can be found here.

Pros:

  1. Smaller application distribution size especially when stripping is not used

Cons:

  1. Worse compatibility with standard and third party libraries

Page last updated: 2011-02-24