Function LayerGridGraph.SetDimensions
SetDimensions
(int width, int depth, float nodeSize)
Updates unclampedSize from width, depth and nodeSize values.
Public
void SetDimensions (
int | width | |
int | depth | |
float | nodeSize |
Updates unclampedSize from width, depth and nodeSize values.
Also generates a new matrix .
Note
This does not rescan the graph, that must be done with Scan
You should use this method instead of setting the width and depth fields as the grid dimensions are not defined by the width and depth variables but by the unclampedSize and center variables.
var gg = AstarPath.active.data.gridGraph;
var width = 80;
var depth = 60;
var nodeSize = 1.0f;
gg.SetDimensions(width, depth, nodeSize);
// Recalculate the graph
AstarPath.active.Scan();