//Get neighbours of this streetcrossing as IPathElement public override List <IPathElement> GetNeighbours() { List <IPathElement> pathElementList = new List <IPathElement>(); NavigationMesh navigationMeshControl = NavigationMesh.getInstance(); //Collect all navMesh neighbours foreach (Vector3 navigationMeshPolyFootpath in this.NavMeshes) { pathElementList.Add(navigationMeshControl.getMeshByPosition(navigationMeshPolyFootpath)); } //Collect all streetCrossings neighbours foreach (Vector3 streetCrossing in this.StreetCrossings) { pathElementList.Add(StreetCrossingControl.MappedStreetCrossings[streetCrossing.ToString()]); } return(pathElementList); }