I would like to access the Pixels To Units property of a sprite from within a C# script in Unity.
If I get either the localScale or lossyScale properties they need to be divided by this number in order to scale in accordance with other objects that may have different values for their Pixels To Units property.
How can I get the value of this property or scale correctly in this situation?
You can't access the property from a script, but you can calculate the factor yourself.
Sprite mySprite;
float pixel2units = mySprite.rect.width / mySprite.bounds.size.x;