protected void CreatePath() { SetAsPath(endWaypoint); endWaypoint.SetTopColor(Color.blue); Waypoint previous = endWaypoint.exploredFrom; while (previous != startWaypoint) { SetAsPath(previous); previous.SetTopColor(Color.blue); previous = previous.exploredFrom; } SetAsPath(startWaypoint); path.Reverse(); }
public void ColorStartAndEnd() { startWaypoint.SetTopColor(Color.green); endWaypoint.SetTopColor(Color.red); }