Unity C#'s version?

So up to what version unity c# support now?

5.0? or 6.0?

You can run this to check the version

Debug.Log(System.Enviroment.Version);
3 Likes

Wait, is there an announcement I missed?

Last I heard we are using an old version of Mono, roughly equivalent to .Net 3.5.

No announcement, nothing has changed.

–Eric

They’re not asking for the framework version. They’re asking for the version of the language itself.

Its essentially the same question.

https://en.wikipedia.org/wiki/C_Sharp_(programming_language)

1 Like

Ah. Got it. I was trying to dig up if they were decoupled or not, but I didn’t think to check the Wiki.

You can use some reflection to find out :):

    usingSystem.Reflection;
    Type type =Type.GetType("Mono.Runtime");
    if(type !=null)
    {
    MethodInfo displayName = type.GetMethod("GetDisplayName",BindingFlags.NonPublic|BindingFlags.Static);
    if(displayName !=null)
    Debug.Log(displayName.Invoke(null,null));
    }

Last i checked it was Unity 5.1 with NET 2.6.5

I believe that should be Mono 2.6.5

Mono version details can also be found on wikipedia

https://en.wikipedia.org/wiki/Mono_(software)

1 Like

lol It seems im missing the mark every time…I think nows the time for me to shut up.

1 Like

Its all good. Most of my Unity knowledge is just copied from @Eric5h5 's old posts. :slight_smile:

4 Likes

(Wonder if I should tell him that I just make everything up.)

–Eric

7 Likes

So, I found this for usage c# 5.0, 6.0 features in unity.

https://bitbucket.org/alexzzzz/unity-c-5.0-and-6.0-integration/src

Just a reminder, from the Roadmap under “IN-PROGRESS, TIMELINES LONG OR UNCERTAIN”:

Also, since the numbering is confusing; Unity uses Mono version 2.6.5-with-some-extra-features (I believe), which supports C# 3. The latest version of Mono is Mono 4, which supports C# 6.

Even a “simple” jump up from 2.6.5 to 2.8 would give us C# 4 and a generational GC, so that would actually be huge.

Mono 2.6 was released back in 2009, while 2.8 was out in 2010. Unity has some real big technological debt here.

1 Like

The features of C# 6.0 that can be implemented in the older CIL code can be implemented.

You are still out of luck with the advanced key words like dynamic.

(I think)

wtb linq and lambda expression for Unity

LINQ extension methods and lambda expressions work just fine in Unity.

.NET 4.5 or is that new in Unity 5+ ?

What about it?