In Unity 3 we upgraded the mono runtime from 1.2.5 to 2.6 and on top of that, there are some JavaScript and Boo improvements. Aside from all bug fixes and improvements to mono between the two versions, this page lists some of the highlights.
Basically the differences betweeen C# 3.5 and C# 2.0, including:
var list = new System.Collections.Generic.List.<String>(); list.Add("foo");
list.Sort(function(x:String, y:String) { return x.CompareTo(y); });
list.Sort(function(x, y) x.CompareTo(y));
function forEach(items, action: function(Object)) { for (var item in items) action(item); }
function printArray(a: int[]) { print("[" + String.Join(", ", [i.ToString() for (i in a)]) + "]"); } var doubles = [i*2 for (i in range(0, 3))]; var odds = [i for (i in range(0, 6)) if (i % 2 != 0)]; printArray(doubles); printArray(odds);
interface IFoo { function bar(); } class Foo implements IFoo { function bar() { Console.WriteLine("Foo.bar"); } }
final function foo() { }
class Pair extends System.ValueType { var First: Object; var Second: Object; function Pair(fst, snd) { First = fst; Second = snd; } override function ToString() { return "Pair(" + First + ", " + Second + ")"; } }
Page last updated: 2011-11-08