C#: Fix incorrect types used in ArrayMesh docs

This commit is contained in:
Raul Santos 2022-11-16 20:22:55 +01:00
parent 2846ea1ffa
commit ef03e05419
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -25,10 +25,12 @@
m.mesh = arr_mesh m.mesh = arr_mesh
[/gdscript] [/gdscript]
[csharp] [csharp]
var vertices = new Godot.Collections.Array<Vector3>(); var vertices = new Vector3[]
vertices.Add(new Vector3(0, 1, 0)); {
vertices.Add(new Vector3(1, 0, 0)); new Vector3(0, 1, 0),
vertices.Add(new Vector3(0, 0, 1)); new Vector3(1, 0, 0),
new Vector3(0, 0, 1),
};
// Initialize the ArrayMesh. // Initialize the ArrayMesh.
var arrMesh = new ArrayMesh(); var arrMesh = new ArrayMesh();
@ -38,7 +40,7 @@
// Create the Mesh. // Create the Mesh.
arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays); arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays);
var m = new MeshInstance(); var m = new MeshInstance3D();
m.Mesh = arrMesh; m.Mesh = arrMesh;
[/csharp] [/csharp]
[/codeblocks] [/codeblocks]