Merge pull request #83839 from todeskurve/todeskurve-patch-ImmediateMesh.xml

Add C# Example to ImmediateMesh.xml
This commit is contained in:
Rémi Verschelde 2023-10-24 10:54:45 +02:00
commit 6ead61ab1e
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -15,6 +15,14 @@
mesh.surface_add_vertex(Vector3.ZERO)
mesh.surface_end()
[/gdscript]
[csharp]
var mesh = new ImmediateMesh();
mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles);
mesh.SurfaceAddVertex(Vector3.Left);
mesh.SurfaceAddVertex(Vector3.Forward);
mesh.SurfaceAddVertex(Vector3.Zero);
mesh.SurfaceEnd();
[/csharp]
[/codeblocks]
[b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often.
</description>