you also have some places among your if statement blocks that you should be adding new lines to keep them separate, it helps when you are reading through the code.
sp1 = camera.WorldToScreenPoint(lines[i].point1); sp2 = camera.WorldToScreenPoint(lines[i].point2); if (lines[i].lineParams.endPoint1Type == EndPointType.HollowCircle) { float endpointRadius = lines[i].lineParams.pointThickness; Vector3 diff = (sp2 - sp1).normalized * endpointRadius; sp1 += diff; } else if (lines[i].lineParams.endPoint1Type == EndPointType.DoubleCircle || lines[i].lineParams.endPoint1Type == EndPointType.DoubleHollowCircle) { float endpointRadius = lines[i].lineParams.pointThickness * doubleCircleRadiusRatio; Vector3 diff = (sp2 - sp1).normalized * endpointRadius; sp1 += diff; } if (lines[i].lineParams.endPoint2Type == EndPointType.HollowCircle) { float endpointRadius = lines[i].lineParams.pointThickness; Vector3 diff = (sp1 - sp2).normalized * endpointRadius; sp2 += diff; } else if (lines[i].lineParams.endPoint2Type == EndPointType.DoubleCircle || lines[i].lineParams.endPoint2Type == EndPointType.DoubleHollowCircle) { float endpointRadius = lines[i].lineParams.pointThickness * doubleCircleRadiusRatio; ; Vector3 diff = (sp1 - sp2).normalized * endpointRadius; sp2 += diff; } DrawLine(sp1, sp2, lines[i].lineParams.lineThickness, lines[i].lineParams.lineColor);
it should look like this
sp1 = camera.WorldToScreenPoint(lines[i].point1);
sp2 = camera.WorldToScreenPoint(lines[i].point2);
if (lines[i].lineParams.endPoint1Type == EndPointType.HollowCircle)
{
float endpointRadius = lines[i].lineParams.pointThickness;
Vector3 diff = (sp2 - sp1).normalized * endpointRadius;
sp1 += diff;
}
else if (lines[i].lineParams.endPoint1Type == EndPointType.DoubleCircle || lines[i].lineParams.endPoint1Type == EndPointType.DoubleHollowCircle)
{
float endpointRadius = lines[i].lineParams.pointThickness * doubleCircleRadiusRatio;
Vector3 diff = (sp2 - sp1).normalized * endpointRadius;
sp1 += diff;
}
if (lines[i].lineParams.endPoint2Type == EndPointType.HollowCircle)
{
float endpointRadius = lines[i].lineParams.pointThickness;
Vector3 diff = (sp1 - sp2).normalized * endpointRadius;
sp2 += diff;
}
else if (lines[i].lineParams.endPoint2Type == EndPointType.DoubleCircle || lines[i].lineParams.endPoint2Type == EndPointType.DoubleHollowCircle)
{
float endpointRadius = lines[i].lineParams.pointThickness * doubleCircleRadiusRatio; ;
Vector3 diff = (sp1 - sp2).normalized * endpointRadius;
sp2 += diff;
}
DrawLine(sp1, sp2, lines[i].lineParams.lineThickness, lines[i].lineParams.lineColor);
so you know that there are two separate if blocks here.