| |
---|
| | } else { |
---|
| | endNode = new CustomNode(groundPosition, transform, config); |
---|
| | } |
---|
| | Road road = new Road(pullingNode, endNode, config); |
---|
| | if (! pullingNode.roads.Contains(road) && pullingNode != endNode) { |
---|
| | if (pullingNode.roads.Contains(road)) { |
---|
| | Road other = pullingNode.roads.Find(it => road.Equals(it)); |
---|
| | if (other.nodes[0] != road.nodes[0]) { |
---|
| | other.nodes = road.nodes; |
---|
| | other.update(true); |
---|
| | } |
---|
| | } else if (pullingNode != endNode) { |
---|
| | pullingNode.roads.Add(road); |
---|
| | endNode.roads.Add(road); |
---|
| | road.initialize(transform); |
---|
| | } else { |
---|
| | Road other = pullingNode.roads.Find(it => road.Equals(it)); |
---|
| | if (other.nodes[0] != road.nodes[0]) { |
---|
| | other.nodes = road.nodes; |
---|
| | other.update(false); |
---|
| | } |
---|
| | } |
---|
| | pullingNode = null; |
---|
| | } |
---|
| | |
---|
| |
---|
| | |