此代码中的含义是什么?#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),
});
}
答案 0 :(得分:4)
只需创建一个隐式类型数组,在代码中它就是一个带有两个元素的顶点位置颜色[]。