static public void DrawFill(ShapeFill shape) { Vector2 pointInWorld; Vector2D pointInWorld2D = Vector2D.Zero(); foreach (Vector2D point in shape.pointsIn) { pointInWorld = shape.transform.TransformPoint(point.ToVector2()); pointInWorld2D.x = pointInWorld.x; pointInWorld2D.y = pointInWorld.y; if (ShapeObject.PointInShapes(pointInWorld2D) == false) { ShapeDraw.Draw(pointInWorld, shape.transform); } } }
public ShapeFillResult(ShapeFill shapeFill) { allPoints = shapeFill.pointsIn.Count; pointsIn = 0; Vector2 pointInWorld; Vector2D pointInWorld2D = Vector2D.Zero(); foreach (Vector2D point in shapeFill.pointsIn) { pointInWorld = shapeFill.transform.TransformPoint(point.ToVector2()); pointInWorld2D.x = pointInWorld.x; pointInWorld2D.y = pointInWorld.y; if (ShapeObject.PointInShapes(pointInWorld2D) == false) { pointsIn++; } } percentage = (float)pointsIn / allPoints; }