Good day! I add new points to the Point Graph in Realtime mode. Everything is well added, but when I try to get the entire list of nodes, I find not only my own nodes but, for example, 144 empty Null nodes. I thought these were my nodes, but my nodes are 366 and they are clean as day …
Maybe I don’t understand what, maybe it’s Cash search engine or something like that?
I’ll show you an example of adding nodes Unity 2019.3.7f1 and Latest A*
private void AddNodes(List<Node> nodes)
{
_pathfinder.AddWorkItem(new AstarWorkItem(ctx =>
{
var graph = _pathfinder.data.pointGraph;
if (graph != null)
{
foreach (var node in nodes)
{
graph.AddNode(node, (Int3)node.Position);
}
graph.ConnectNodes();
graph.RebuildNodeLookup(); // researching what it is...
}
}));
}
And the code with which I get null nodes :
void Start()
{
//Delayed call because access may not have been initialized yet.
DOVirtual.DelayedCall(1f, () =>
{
var pointnodes = AstarPath.active.data.pointGraph.nodes;
var i = 0;
foreach (var item in pointnodes)
{
Debug.LogError($" Node : {item}, Index : { i++}");
}
});
}
Thanks for any help, this is not a huge problem, but it would be nice to get rid of empty objects - nodes.