mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
[.NET] Use collection expressions in docs
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
This commit is contained in:
@@ -25,16 +25,16 @@
|
||||
m.mesh = arr_mesh
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var vertices = new Vector3[]
|
||||
{
|
||||
Vector3[] vertices =
|
||||
[
|
||||
new Vector3(0, 1, 0),
|
||||
new Vector3(1, 0, 0),
|
||||
new Vector3(0, 0, 1),
|
||||
};
|
||||
];
|
||||
|
||||
// Initialize the ArrayMesh.
|
||||
var arrMesh = new ArrayMesh();
|
||||
var arrays = new Godot.Collections.Array();
|
||||
Godot.Collections.Array arrays = [];
|
||||
arrays.Resize((int)Mesh.ArrayType.Max);
|
||||
arrays[(int)Mesh.ArrayType.Vertex] = vertices;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user