public void AddChild(int parentNodeId, int childnodeId)
{
int length = childCount[parentNodeId];
if (length >= nodeChildren[parentNodeId].Length)
{
ResizeChildren(parentNodeId);
}
nodeChildren[parentNodeId][length++] = childnodeId;
childCount[parentNodeId] = length;
if (length > 1 && singlePath)
{
singlePath = false;
}
}