In Sprite Editor, how can I get theese values by code? (screenshot)

I searched the scripting API but I can’t find the sprite’s Width and Height variables (which are different from the rect that contains the sprite). Any clues?51003-sem-titulo.png

This will return the rect that contains those values:

var rect = GetComponent<SpriteRenderer>().sprite.rect

It has x, y, width, and height values that correspond with the values in your screenshot.