int startIndex = line.IndexOf("nodenumber");
本行代码忘记替换查找索引名称,导致没能读取指定文件数据,造成一直再修改查找最近六个节点数据的方法。
private List<NodeData> FindClosestNodes(Vector3 position, int n)
{
return C_Data
.Select(node => new { Node = node, Distance = Vector3.Distance(position, new Vector3(node.origX, node.origY, node.origZ)) })
.OrderBy(x => x.Distance)
.Take(n)
.Select(x => x.Node)
.ToList();
}
一直以为是这个代码的问题,结果是查询出现了问题!