How do I get the positions of the corners of a sprite?

I have the sprite of a rectangle and I’d like to get the positions of it’s corners in the form of multiples vector2 for example.

Subtract the half of width and height from it’s coordinates

When you have also a rotation, this should do the job:

/// <summary>
///   Returns corners of a sprite in order [TopRight, TopLeft, BottomLeft, BottomRight]
/// </summary>
public static Vector3[] GetSpriteCorners(SpriteRenderer renderer)
{
    Vector3 topRight = renderer.transform.TransformPoint(renderer.sprite.bounds.max);
    Vector3 topLeft = renderer.transform.TransformPoint(new Vector3(renderer.sprite.bounds.max.x, renderer.sprite.bounds.min.y, 0));
    Vector3 botLeft = renderer.transform.TransformPoint(renderer.sprite.bounds.min);
    Vector3 botRight = renderer.transform.TransformPoint(new Vector3(renderer.sprite.bounds.min.x, renderer.sprite.bounds.max.y, 0));
    return new Vector3[] { topRight, topLeft, botLeft, botRight };
}