Hi have been customizing this for our game.
Just wanted to know the best way to create a duplicate of a grid graph eg
hard copy AstarPath.active.graphs[1] to AstarPath.active.graphs[3] (at runtime/ level load);
So i can then add the special connections to the new instance and choose which grid the ai should use based upon its capabilities.
void ConnectJumpSpot(int graphNumber)
{
var graph = AstarPath.active.graphs[graphNumber];
GraphNode startNode = graph.GetNearest(from, NNConstraint.Default).node;
GraphNode toNode = graph.GetNearest(to, NNConstraint.Default).node;
startNode.AddSpecialAction(GraphNodeSpecialAction.JumpForwards, jumpPoint);
startNode.AddConnection(toNode, 0);
jumpPoint.FromNode = startNode;
toNode.AddSpecialAction(GraphNodeSpecialAction.JumpBackwards, jumpPoint);
toNode.AddConnection(startNode, 0);
jumpPoint.ToNode = toNode;
}
This is for a pro layered grid graph.
Have already edited the base code to work with the special actions in aipath.
Cheers