Function LayerGridGraph.AlignToTilemap

AlignToTilemap (UnityEngine.GridLayout grid)

Aligns this grid to a given tilemap or grid layout.

Public
void AlignToTilemap (

UnityEngine.GridLayout

grid

)

Aligns this grid to a given tilemap or grid layout.

This is very handy if your game uses a tilemap for rendering and you want to make sure the graph is laid out exactly the same. Matching grid parameters manually can be quite tricky in some cases.

The inspector will automatically show a button to align to a tilemap if one is detected in the scene. If no tilemap is detected, the button be hidden.

Note

This will not change the width/height of the graph. It only aligns the graph to the closest orientation so that the grid nodes will be aligned to the cells in the tilemap. You can adjust the width/height of the graph separately using e.g. SetDimensions.

The following parameters will be updated: