Upgraded Mono .NET 4.6 in Unity 5.5
Posted: 29 Sep 2016, 22:38
There is now an experimental build of Unity 5.5.0b4 with .NET 4.6!
https://forum.unity3d.com/threads/upgra ... b4.433541/
So we can now use new C# 6 language features.
It simplifies PropertyChanged with the Safe Navigation Operator (?.), CallerMemberName and nameof(): https://jeremybytes.blogspot.nl/2016/02 ... of-in.html
CallerMemberName
Visual Studio will offer to convert your old school PropertyChanged implementation using null checks with a single line thread-safe delegate invocation using the ?. operator.

With .NET 4.5's CallerMemberName not only you don't have to use magic strings, moreoever you don't even have to type the property name at all.

nameof()


A bit more verbose than CallerMemberName, but the article linked above favors it for human readability. You're still avoiding magic strings with the literal property name, so refactoring won't break your code anymore.
MVVM classes
The MVVM classes are now built-in. System.Collection.ObjectModel.ObservableCollection, System.Windows.Input.ICommand, System.ComponentModel.INotifyPropertyChanged, etc.
https://forum.unity3d.com/threads/upgra ... b4.433541/
So we can now use new C# 6 language features.
It simplifies PropertyChanged with the Safe Navigation Operator (?.), CallerMemberName and nameof(): https://jeremybytes.blogspot.nl/2016/02 ... of-in.html
CallerMemberName
Visual Studio will offer to convert your old school PropertyChanged implementation using null checks with a single line thread-safe delegate invocation using the ?. operator.

With .NET 4.5's CallerMemberName not only you don't have to use magic strings, moreoever you don't even have to type the property name at all.

nameof()


A bit more verbose than CallerMemberName, but the article linked above favors it for human readability. You're still avoiding magic strings with the literal property name, so refactoring won't break your code anymore.
MVVM classes
The MVVM classes are now built-in. System.Collection.ObjectModel.ObservableCollection, System.Windows.Input.ICommand, System.ComponentModel.INotifyPropertyChanged, etc.