Unity Take A Small Step Toward Modern C# Support

 

One of the most rage inspiring things about Unity is it uses a version of Mono ( the C# runtime and compiler used by Unity ) is absolutely ancient.  In fact it’s about 7 years out of date and a lot has changed for the better in the C# language since then.  Earlier this year however, Microsoft acquired Xamarin, then in March, Mono was open sourced.  Now with license issues removed, Unity have started taking baby steps towards modern C# support.  They just announced an experimental upgraded C# compiler compatible with version 5.3.5p8.

Here is a build matching our 5.3.5p8 patch release with the upgraded C# compiler included:

http://bit.ly/29Vvn7W


Please backup your project before trying this build.
Please post any issues you have to this forum.
The upgraded Mono C# compiler (corresponding to Mono 4.4) will be used to compile all your C# scripts.
Important Notes

  • The Mono runtime we use in our Editor and Players has not been upgraded.
  • The compiler still targets the C# 4 language. This is approximately what our old compiler supported.
  • The compiler still target the .Net 3.5 framework profile we previously supported.

This is the first step towards the mythical “Mono/.Net Upgrade”.

 

So basically they are supporting the newest compiler, but not the newest language version.  Basically it’s using the new compiler to compile C# 4.0 style code, at least for now.  Why not simply support C# 6 now?  Well, that’s covered in the FAQ:

Why don’t we target C# 5 or C# 6?
As a first step, we are just rolling out the new compiler. We may enable newer C# features in the future.
A few issues with supporting newer C#

  • Our ecosystem does not completely handle newer C# yet (script updater, debugger, certain MonoDevelop/VisualStudio versions)
  • We are still targeting the old 3.5 .Net profile. It’s somewhat confusing to support newer C# while still targeting an older framework. Writing code from scratch may work, but any existing code probably needs both new C# and new framework.

 

As I said… baby steps.  But certainly a step in the right direction!

GameDev News


Scroll to Top