指定範囲内のVector2Intの配列を作る

public class TestClass
{
    public void TestMethod()
    {
        var countX = 3;
        var countY = 4;
        
        var aaa = Enumerable.Range(0, countY)
            .SelectMany(y => Enumerable.Range(0, countX)
                .Select(x => new Vector2Int(x, y)));
                
        // (x:0, y:0), (x:1, y:0), (x:2, y:0),
        // (x:0, y:1), (x:1, y:1), (x:2, y:1),
        // (x:0, y:2), (x:1, y:2), (x:2, y:2),
        // (x:0, y:3), (x:1, y:2), (x:2, y:3)
    }
}

コメント

このブログの人気の投稿

fontconfigの設定

VLCでBlu-rayを再生

UEFIのブートオーダーを一時的に変更する