[.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:
@ -204,7 +204,7 @@
|
||||
print(polygon) # Prints [(50.0, 50.0), (150.0, 50.0), (150.0, 150.0), (50.0, 150.0)]
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100) };
|
||||
Vector2[] polygon = [new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100)];
|
||||
var offset = new Vector2(50, 50);
|
||||
polygon = new Transform2D(0, offset) * polygon;
|
||||
GD.Print((Variant)polygon); // Prints [(50, 50), (150, 50), (150, 150), (50, 150)]
|
||||
|
||||
Reference in New Issue
Block a user