private void AddLine() { if (roadSystem.intersections.Count > 1) { //int n1 = pts.Count - 1; //int n2 = pts.Count - 2; if (lastNode != null) //if (n2 != pause) { //int ii = roadSystem.intersections.Count - 1; //Intersection it1 = roadSystem.intersections[ii - 1]; //Intersection it2 = roadSystem.intersections[ii]; //Intersection itrA = new Intersection(pts[n2]); //Intersection itrB = new Intersection(pts[n1]); //Road road = new Road(itrA,itrB); // Road road = new Road(it1, it2); Debug.Log("C:" + currNode.position.x); Debug.Log("L:" + lastNode.position.x); Road road = new Road(currNode, lastNode); roads.Add(road); roadSystem.AddRoad(road); } } }