Merge pull request #10441 from godotengine/classref/sync-99a8ab7

classref: Sync with current master branch (99a8ab7)
This commit is contained in:
Max Hilbrunner
2024-12-28 05:41:13 +01:00
committed by GitHub
22 changed files with 146 additions and 88 deletions

View File

@@ -2329,7 +2329,7 @@ Key Code mask.
.. rst-class:: classref-enumeration-constant
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MODIFIER_MASK** = ``532676608``
:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>` **KEY_MODIFIER_MASK** = ``2130706432``
Modifier key mask.
@@ -6452,7 +6452,7 @@ Converts one or more arguments of any type to string in the best way possible an
.. code-tab:: csharp
var a = new Godot.Collections.Array { 1, 2, 3 };
Godot.Collections.Array a = [1, 2, 3];
GD.Print("a", "b", a); // Prints ab[1, 2, 3]

View File

@@ -35,14 +35,14 @@ An array data structure that can contain a sequence of elements of any :ref:`Var
.. code-tab:: csharp
var array = new Godot.Collections.Array{"First", 2, 3, "Last"};
Godot.Collections.Array array = ["First", 2, 3, "Last"];
GD.Print(array[0]); // Prints "First"
GD.Print(array[2]); // Prints 3
GD.Print(array[array.Count - 1]); // Prints "Last"
GD.Print(array[^1]); // Prints "Last"
array[2] = "Second";
array[1] = "Second";
GD.Print(array[1]); // Prints "Second"
GD.Print(array[array.Count - 3]); // Prints "Second"
GD.Print(array[^3]); // Prints "Second"
@@ -707,7 +707,7 @@ This method can often be combined with :ref:`resize<class_Array_method_resize>`
.. code-tab:: csharp
var array = new Godot.Collections.Array();
Godot.Collections.Array array = [];
array.Resize(5);
array.Fill(2);
GD.Print(array); // Prints [2, 2, 2, 2, 2]
@@ -874,7 +874,7 @@ Returns ``true`` if the array contains the given ``value``.
.. code-tab:: csharp
var arr = new Godot.Collections.Array { "inside", 7 };
Godot.Collections.Array arr = ["inside", 7];
// By C# convention, this method is renamed to `Contains`.
GD.Print(arr.Contains("inside")); // Prints True
GD.Print(arr.Contains("outside")); // Prints False
@@ -1068,7 +1068,7 @@ Returns a random element from the array. Generates an error and returns ``null``
.. code-tab:: csharp
var array = new Godot.Collections.Array { 1, 2, 3.25f, "Hi" };
Godot.Collections.Array array = [1, 2, 3.25f, "Hi"];
GD.Print(array.PickRandom()); // May print 1, 2, 3.25, or "Hi".
@@ -1355,7 +1355,7 @@ Sorts the array in ascending order. The final order is dependent on the "less th
.. code-tab:: csharp
var numbers = new Godot.Collections.Array { 10, 5, 2.5, 8 };
Godot.Collections.Array numbers = [10, 5, 2.5, 8];
numbers.Sort();
GD.Print(numbers); // Prints [2.5, 5, 8, 10]
@@ -1448,8 +1448,8 @@ Appends the ``right`` array to the left operand, creating a new **Array**. This
.. code-tab:: csharp
// Note that concatenation is not possible with C#'s native Array type.
var array1 = new Godot.Collections.Array{"One", 2};
var array2 = new Godot.Collections.Array{3, "Four"};
Godot.Collections.Array array1 = ["One", 2];
Godot.Collections.Array array2 = [3, "Four"];
GD.Print(array1 + array2); // Prints ["One", 2, 3, "Four"]

View File

@@ -46,16 +46,16 @@ The most basic example is the creation of a single triangle:
.. code-tab:: 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;

View File

@@ -4440,7 +4440,7 @@ Passing an empty array will disable passthrough support (all mouse events will b
DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
// Reset region to default.
DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
DisplayServer.WindowSetMousePassthrough([]);

View File

@@ -39,7 +39,7 @@ Below a small example of how to use it:
server.listen(4242)
var key = load("key.key") # Your private key.
var cert = load("cert.crt") # Your X509 certificate.
dtls.setup(key, cert)
dtls.setup(TlsOptions.server(key, cert))
func _process(delta):
while server.is_connection_available():
@@ -66,19 +66,19 @@ Below a small example of how to use it:
{
private DtlsServer _dtls = new DtlsServer();
private UdpServer _server = new UdpServer();
private Godot.Collections.Array<PacketPeerDtls> _peers = new Godot.Collections.Array<PacketPeerDtls>();
private Godot.Collections.Array<PacketPeerDtls> _peers = [];
public override void _Ready()
{
_server.Listen(4242);
var key = GD.Load<CryptoKey>("key.key"); // Your private key.
var cert = GD.Load<X509Certificate>("cert.crt"); // Your X509 certificate.
_dtls.Setup(key, cert);
_dtls.Setup(TlsOptions.Server(key, cert));
}
public override void _Process(double delta)
{
while (Server.IsConnectionAvailable())
while (_server.IsConnectionAvailable())
{
PacketPeerUdp peer = _server.TakeConnection();
PacketPeerDtls dtlsPeer = _dtls.TakeConnection(peer);

View File

@@ -85,7 +85,7 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh<class_Mesh>` fr
public override string[] _GetRecognizedExtensions()
{
return new string[] { "special", "spec" };
return ["special", "spec"];
}
public override string _GetSaveExtension()
@@ -110,14 +110,14 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh<class_Mesh>` fr
public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetImportOptions(string path, int presetIndex)
{
return new Godot.Collections.Array<Godot.Collections.Dictionary>
{
return
[
new Godot.Collections.Dictionary
{
{ "name", "myOption" },
{ "default_value", false },
}
};
},
];
}
public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array<string> platformVariants, Godot.Collections.Array<string> genFiles)

View File

@@ -699,6 +699,8 @@ Plays the main scene.
|void| **popup_create_dialog**\ (\ callback\: :ref:`Callable<class_Callable>`, base_type\: :ref:`StringName<class_StringName>` = "", current_type\: :ref:`String<class_String>` = "", dialog_title\: :ref:`String<class_String>` = "", type_blocklist\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = [], type_suffixes\: :ref:`Dictionary<class_Dictionary>` = {}\ ) :ref:`🔗<class_EditorInterface_method_popup_create_dialog>`
**Experimental:** This method may be changed or removed in future versions.
Pops up an editor dialog for creating an object.
The ``callback`` must take a single argument of type :ref:`StringName<class_StringName>` which will contain the type name of the selected object or be empty if no item is selected.

View File

@@ -273,8 +273,6 @@ Properties
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Color<class_Color>` | :ref:`editors/bone_mapper/handle_colors/unset<class_EditorSettings_property_editors/bone_mapper/handle_colors/unset>` |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`editors/grid_map/editor_side<class_EditorSettings_property_editors/grid_map/editor_side>` |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`editors/grid_map/palette_min_width<class_EditorSettings_property_editors/grid_map/palette_min_width>` |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`editors/grid_map/pick_distance<class_EditorSettings_property_editors/grid_map/pick_distance>` |
@@ -2275,18 +2273,6 @@ The modulate color to use for "past" frames displayed in the animation editor's
----
.. _class_EditorSettings_property_editors/grid_map/editor_side:
.. rst-class:: classref-property
:ref:`int<class_int>` **editors/grid_map/editor_side** :ref:`🔗<class_EditorSettings_property_editors/grid_map/editor_side>`
Specifies the side of 3D editor's viewport where GridMap's mesh palette will appear.
.. rst-class:: classref-item-separator
----
.. _class_EditorSettings_property_editors/grid_map/palette_min_width:
.. rst-class:: classref-property

View File

@@ -69,7 +69,7 @@ Below shows an example of a custom parser that extracts strings from a CSV file
public override string[] _GetRecognizedExtensions()
{
return new string[] { "csv" };
return ["csv"];
}
}
@@ -92,11 +92,11 @@ To add a translatable string associated with context or plural, add it to ``msgi
.. code-tab:: csharp
// This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals".
msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"});
msgidsContextPlural.Add(["Test 1", "context", "test 1 Plurals"]);
// This will add a message with msgid "A test without context" and msgid_plural "plurals".
msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"});
msgidsContextPlural.Add(["A test without context", "", "plurals"]);
// This will add a message with msgid "Only with context" and msgctxt "a friendly context".
msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""});
msgidsContextPlural.Add(["Only with context", "a friendly context", ""]);
@@ -126,7 +126,7 @@ To add a translatable string associated with context or plural, add it to ``msgi
public override string[] _GetRecognizedExtensions()
{
return new string[] { "gd" };
return ["gd"];
}

View File

@@ -500,7 +500,7 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole)
.. code-tab:: 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)]

View File

@@ -1092,7 +1092,7 @@ To create a POST request with query strings to push to the server, do:
var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } };
string queryString = new HttpClient().QueryStringFromDict(fields);
string[] headers = { "Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}" };
string[] headers = ["Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}"];
var result = new HttpClient().Request(HttpClient.Method.Post, "index.php", headers, queryString);

View File

@@ -39,7 +39,7 @@ To bake a navigation mesh at least one outline needs to be added that defines th
.. code-tab:: csharp
var newNavigationMesh = new NavigationPolygon();
var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
Vector2[] boundingOutline = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)];
newNavigationMesh.AddOutline(boundingOutline);
NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new NavigationMeshSourceGeometryData2D());
GetNode<NavigationRegion2D>("NavigationRegion2D").NavigationPolygon = newNavigationMesh;
@@ -63,9 +63,9 @@ Adding vertices and polygon indices manually.
.. code-tab:: csharp
var newNavigationMesh = new NavigationPolygon();
var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
Vector2[] newVertices = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)];
newNavigationMesh.Vertices = newVertices;
var newPolygonIndices = new int[] { 0, 1, 2, 3 };
int[] newPolygonIndices = [0, 1, 2, 3];
newNavigationMesh.AddPolygon(newPolygonIndices);
GetNode<NavigationRegion2D>("NavigationRegion2D").NavigationPolygon = newNavigationMesh;

View File

@@ -199,6 +199,8 @@ Methods
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_regions<class_NavigationServer2D_method_map_get_regions>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_get_use_async_iterations<class_NavigationServer2D_method_map_get_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_get_use_edge_connections<class_NavigationServer2D_method_map_get_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer2D_method_map_is_active>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
@@ -211,6 +213,8 @@ Methods
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_link_connection_radius<class_NavigationServer2D_method_map_set_link_connection_radius>`\ (\ map\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_use_async_iterations<class_NavigationServer2D_method_map_set_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_use_edge_connections<class_NavigationServer2D_method_map_set_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`obstacle_create<class_NavigationServer2D_method_obstacle_create>`\ (\ ) |
@@ -1226,6 +1230,18 @@ Returns all navigation regions :ref:`RID<class_RID>`\ s that are currently assig
----
.. _class_NavigationServer2D_method_map_get_use_async_iterations:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **map_get_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_use_async_iterations>`
Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread.
.. rst-class:: classref-item-separator
----
.. _class_NavigationServer2D_method_map_get_use_edge_connections:
.. rst-class:: classref-method
@@ -1298,6 +1314,18 @@ Set the map's link connection radius used to connect links to navigation polygon
----
.. _class_NavigationServer2D_method_map_set_use_async_iterations:
.. rst-class:: classref-method
|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_use_async_iterations>`
If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread.
.. rst-class:: classref-item-separator
----
.. _class_NavigationServer2D_method_map_set_use_edge_connections:
.. rst-class:: classref-method

View File

@@ -219,6 +219,8 @@ Methods
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`map_get_up<class_NavigationServer3D_method_map_get_up>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_get_use_async_iterations<class_NavigationServer3D_method_map_get_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_get_use_edge_connections<class_NavigationServer3D_method_map_get_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer3D_method_map_is_active>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
@@ -237,6 +239,8 @@ Methods
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_up<class_NavigationServer3D_method_map_set_up>`\ (\ map\: :ref:`RID<class_RID>`, up\: :ref:`Vector3<class_Vector3>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_use_async_iterations<class_NavigationServer3D_method_map_set_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`map_set_use_edge_connections<class_NavigationServer3D_method_map_set_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`obstacle_create<class_NavigationServer3D_method_obstacle_create>`\ (\ ) |
@@ -1501,6 +1505,18 @@ Returns the map's up direction.
----
.. _class_NavigationServer3D_method_map_get_use_async_iterations:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **map_get_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer3D_method_map_get_use_async_iterations>`
Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread.
.. rst-class:: classref-item-separator
----
.. _class_NavigationServer3D_method_map_get_use_edge_connections:
.. rst-class:: classref-method
@@ -1609,6 +1625,18 @@ Sets the map up direction.
----
.. _class_NavigationServer3D_method_map_set_use_async_iterations:
.. rst-class:: classref-method
|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer3D_method_map_set_use_async_iterations>`
If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread.
.. rst-class:: classref-item-separator
----
.. _class_NavigationServer3D_method_map_set_use_edge_connections:
.. rst-class:: classref-method

View File

@@ -355,14 +355,14 @@ Combined with :ref:`_set<class_Object_private_method__set>` and :ref:`_get_prope
public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList()
{
return new Godot.Collections.Array<Godot.Collections.Dictionary>()
{
return
[
new Godot.Collections.Dictionary()
{
{ "name", "FakeProperty" },
{ "type", (int)Variant.Type.Int }
}
};
{ "type", (int)Variant.Type.Int },
},
];
}
@@ -445,11 +445,11 @@ The example below displays a list of numbers shown as words going from ``ZERO``
}
}
private Godot.Collections.Array<int> _numbers = new();
private Godot.Collections.Array<int> _numbers = [];
public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList()
{
var properties = new Godot.Collections.Array<Godot.Collections.Dictionary>();
Godot.Collections.Array<Godot.Collections.Dictionary> properties = [];
for (int i = 0; i < _numberCount; i++)
{
@@ -690,14 +690,14 @@ Combined with :ref:`_get<class_Object_private_method__get>` and :ref:`_get_prope
public override Godot.Collections.Array<Godot.Collections.Dictionary> _GetPropertyList()
{
return new Godot.Collections.Array<Godot.Collections.Dictionary>()
{
return
[
new Godot.Collections.Dictionary()
{
{ "name", "FakeProperty" },
{ "type", (int)Variant.Type.Int }
}
};
{ "type", (int)Variant.Type.Int },
},
];
}
@@ -810,19 +810,19 @@ Adds a user-defined signal named ``signal``. Optional arguments for the signal c
.. code-tab:: csharp
AddUserSignal("Hurt", new Godot.Collections.Array()
{
AddUserSignal("Hurt",
[
new Godot.Collections.Dictionary()
{
{ "name", "damage" },
{ "type", (int)Variant.Type.Int }
{ "type", (int)Variant.Type.Int },
},
new Godot.Collections.Dictionary()
{
{ "name", "source" },
{ "type", (int)Variant.Type.Object }
}
});
{ "type", (int)Variant.Type.Object },
},
]);
@@ -924,7 +924,7 @@ Calls the ``method`` on the object and returns the result. Unlike :ref:`call<cla
.. code-tab:: csharp
var node = new Node3D();
node.Callv(Node3D.MethodName.Rotate, new Godot.Collections.Array { new Vector3(1f, 0f, 0f), 1.571f });
node.Callv(Node3D.MethodName.Rotate, [new Vector3(1f, 0f, 0f), 1.571f]);

View File

@@ -527,7 +527,7 @@ If the process is successfully created, this method returns its process ID, whic
.. code-tab:: csharp
var pid = OS.CreateProcess(OS.GetExecutablePath(), new string[] {});
var pid = OS.CreateProcess(OS.GetExecutablePath(), []);
@@ -601,8 +601,8 @@ For example, to retrieve a list of the working directory's contents:
.. code-tab:: csharp
var output = new Godot.Collections.Array();
int exitCode = OS.Execute("ls", new string[] {"-l", "/tmp"}, output);
Godot.Collections.Array output = [];
int exitCode = OS.Execute("ls", ["-l", "/tmp"], output);
@@ -618,8 +618,8 @@ If you wish to access a shell built-in or execute a composite command, a platfor
.. code-tab:: csharp
var output = new Godot.Collections.Array();
OS.Execute("CMD.exe", new string[] {"/C", "cd %TEMP% && dir"}, output);
Godot.Collections.Array output = [];
OS.Execute("CMD.exe", ["/C", "cd %TEMP% && dir"], output);

View File

@@ -793,7 +793,7 @@ Returns a hexadecimal representation of this array as a :ref:`String<class_Strin
.. code-tab:: csharp
var array = new byte[] {11, 46, 255};
byte[] array = [11, 46, 255];
GD.Print(array.HexEncode()); // Prints: 0b2eff

View File

@@ -144,13 +144,13 @@ Returns ``true`` if ``point`` falls inside the polygon area.
.. code-tab:: csharp
var polygonPathFinder = new PolygonPathFinder();
var points = new Vector2[]
{
Vector2[] points =
[
new Vector2(0.0f, 0.0f),
new Vector2(1.0f, 0.0f),
new Vector2(0.0f, 1.0f)
};
var connections = new int[] { 0, 1, 1, 2, 2, 0 };
];
int[] connections = [0, 1, 1, 2, 2, 0];
polygonPathFinder.Setup(points, connections);
GD.Print(polygonPathFinder.IsPointInside(new Vector2(0.2f, 0.2f))); // Prints True
GD.Print(polygonPathFinder.IsPointInside(new Vector2(1.0f, 1.0f))); // Prints False
@@ -198,13 +198,13 @@ The length of ``connections`` must be even, returns an error if odd.
.. code-tab:: csharp
var polygonPathFinder = new PolygonPathFinder();
var points = new Vector2[]
{
Vector2[] points =
[
new Vector2(0.0f, 0.0f),
new Vector2(1.0f, 0.0f),
new Vector2(0.0f, 1.0f)
};
var connections = new int[] { 0, 1, 1, 2, 2, 0 };
];
int[] connections = [0, 1, 1, 2, 2, 0];
polygonPathFinder.Setup(points, connections);

View File

@@ -1211,6 +1211,8 @@ Properties
+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`navigation/pathfinding/max_threads<class_ProjectSettings_property_navigation/pathfinding/max_threads>` | ``4`` |
+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`navigation/world/map_use_async_iterations<class_ProjectSettings_property_navigation/world/map_use_async_iterations>` | ``true`` |
+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`network/limits/debugger/max_chars_per_second<class_ProjectSettings_property_network/limits/debugger/max_chars_per_second>` | ``32768`` |
+---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`network/limits/debugger/max_errors_per_second<class_ProjectSettings_property_network/limits/debugger/max_errors_per_second>` | ``400`` |
@@ -9196,6 +9198,18 @@ Maximum number of threads that can run pathfinding queries simultaneously on the
----
.. _class_ProjectSettings_property_navigation/world/map_use_async_iterations:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **navigation/world/map_use_async_iterations** = ``true`` :ref:`🔗<class_ProjectSettings_property_navigation/world/map_use_async_iterations>`
If enabled, navigation map synchronization uses an async process that runs on a background thread. This avoids stalling the main thread but adds an additional delay to any navigation map change.
.. rst-class:: classref-item-separator
----
.. _class_ProjectSettings_property_network/limits/debugger/max_chars_per_second:
.. rst-class:: classref-property

View File

@@ -1231,7 +1231,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by
.. code-tab:: csharp
var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"};
string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"];
// In C#, this method is static.
GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi"

View File

@@ -1171,7 +1171,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by
.. code-tab:: csharp
var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"};
string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"];
// In C#, this method is static.
GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi"

View File

@@ -1326,13 +1326,13 @@ Passing an empty array will disable passthrough support (all mouse events will b
.. code-tab:: csharp
// Set region, using Path2D node.
GetNode<Window>("Window").MousePassthrough = GetNode<Path2D>("Path2D").Curve.GetBakedPoints();
GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Path2D>("Path2D").Curve.GetBakedPoints();
// Set region, using Polygon2D node.
GetNode<Window>("Window").MousePassthrough = GetNode<Polygon2D>("Polygon2D").Polygon;
GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Polygon2D>("Polygon2D").Polygon;
// Reset region to default.
GetNode<Window>("Window").MousePassthrough = new Vector2[] {};
GetNode<Window>("Window").MousePassthroughPolygon = [];