Ejemplo n.º 1
0
    public float DistanceTo(ShipStructure structure)
    {
        Vector2 closestShipPoint      = structure.ClosestPoint(transform.position);
        Vector2 closestComponentPoint = collider2d.ClosestPoint(closestShipPoint);

        return(Vector2.Distance(closestShipPoint, closestComponentPoint));
    }
Ejemplo n.º 2
0
    public float DistanceTo(ShipStructure structure)
    {
        Vector2 closestOtherPoint = structure.ClosestPoint(transform.position);
        Vector2 closestPoint      = ClosestPoint(closestOtherPoint);

        return(Vector2.Distance(closestOtherPoint, closestPoint));
    }