Why can't Unity work with C# 6 code? It always gives me compiler errors. Here are some code examples:
using static System.Convert;
using static System.Environment;
$"€{punten}{NewLine}€{Money}{NewLine}€{KilledEnemies}{NewLine}€{bonus}{NewLine}€{total}";
I use Visual Studio as my code editor and build with no errors. If I press play in Unity it won't build.
Answer
Unity uses an old version of Mono runtime which is based on .NET3.5. It uses something between C# 3 and 4 in terms of features.
I found this by googling around. Not sure if it works but might be something worth investigating.
No comments:
Post a Comment