以下の内容はhttps://baba-s.hatenablog.com/entry/2019/09/03/230800より取得しました。


【C#】Vector2Int の代入を簡略化する Deconstruction

ソースコード

using UnityEngine;

public static class Vector2IntExt
{
    public static void Deconstruct
    (
        this Vector2Int self,
        out  int        x,
        out  int        y
    )
    {
        x = self.x;
        y = self.y;
    }
}

使用例

通常

var vec = new Vector2Int( 1, 2 );

Deconstruction

var ( x, y ) = new Vector2Int( 1, 2 );



以上の内容はhttps://baba-s.hatenablog.com/entry/2019/09/03/230800より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14