Getting 2nd graph


#1

So this gives me the first graph
LayerGridGraph layerGridGraph = AstarPath.active.astarData.layerGridGraph;

But how do I get the 2nd, or 3rd, or 4th graph?


#2

Hi

You can access the underlaying graphs array.

AstarPath.active.data.graphs[i];

#3

Thanks for your response. How do I access data for that graph using that?

e.g what would be the equivalent of this? AstarPath.active.astarData.layerGridGraph.center

Thanks


#4
var graph = AstarPath.active.data.graphs[i] as LayerGridGraph;
var center = graph.center;