mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 17:28:58 +00:00
classref: Sync with current master branch (518b9e580)
This commit is contained in:
@@ -38,11 +38,11 @@ In contrast to :ref:`AStar2D<class_AStar2D>`, you only need set the :ref:`size<c
|
||||
.. code-tab:: csharp
|
||||
|
||||
AStarGrid2D astarGrid = new AStarGrid2D();
|
||||
astarGrid.Size = new Vector2i(32, 32);
|
||||
astarGrid.CellSize = new Vector2i(16, 16);
|
||||
astarGrid.Size = new Vector2I(32, 32);
|
||||
astarGrid.CellSize = new Vector2I(16, 16);
|
||||
astarGrid.Update();
|
||||
GD.Print(astarGrid.GetIdPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
|
||||
GD.Print(astarGrid.GetPointPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
|
||||
GD.Print(astarGrid.GetIdPath(Vector2I.Zero, new Vector2I(3, 4))); // prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
|
||||
GD.Print(astarGrid.GetPointPath(Vector2I.Zero, new Vector2I(3, 4))); // prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user