C# 7.0 新機能の分解(Deconstruction)を Unity の Vector2、Vector3、Vector4、Color、Rect などのいくつかの型で使用できるようにするパッケージ
var table = new Dictionary<int, string>();
foreach ( var ( key, value ) in table )
{
}
var ( x, y ) = new Vector2( 1, 2 );
var ( x, y ) = new Vector2Int( 1, 2 );
var ( x, y ) = new Vector3( 1, 2, 3 );
var ( x, y, z ) = new Vector3( 1, 2, 3 );
var ( x, y, z ) = new Vector3Int( 1, 2, 3 );
var ( x, y ) = new Vector4( 1, 2, 3, 4 );
var ( x, y, z ) = new Vector4( 1, 2, 3, 4 );
var ( x, y, z, w ) = new Vector4( 1, 2, 3, 4 );
var ( r, g, b ) = new Color( 1, 0.75f, 0.5f, 0.25f );
var ( r, g, b, a ) = new Color( 1, 0.75f, 0.5f, 0.25f );
var ( r, g, b ) = new Color32( 255, 192, 128, 64 );
var ( r, g, b, a ) = new Color32( 255, 192, 128, 64 );
var ( x, y, width, height ) = new Rect( 1, 2, 3, 4 );
var ( position, size ) = new Rect( 1, 2, 3, 4 );
var ( year, month, day ) = new DateTime( 2019, 1, 2, 3, 4, 5 );
var ( year, month, day, hour, minute, second ) = new DateTime( 2019, 1, 2, 3, 4, 5 );
var ( hasValue, value ) = new int?();
var ( hasValue, value ) = new int?( 25 );