c#中new [] {}的含义

时间:2014-08-15 04:21:10

标签: c#

此代码中的含义是什么?#34; new [] {}" ?

public Cube(Game game) : base(game)
{
    vertices = Buffer.Vertex.New(
        game.GraphicsDevice,
        new[]
            {
                new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.OrangeRed),
                new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.OrangeRed),
            });
}

1 个答案:

答案 0 :(得分:4)

只需创建一个隐式类型数组,在代码中它就是一个带有两个元素的顶点位置颜色[]。