The baker in SpriteSettingsAuthoringModule.cs calculates the size of a sprite in a very different way than standard unity conventions dictate. The rendered size of a sprite ends up introducing a novel unnecessary scale scalar and ignoring the conventional pixels per unit. This also implicitly assumes that all sprites in a sheet are the same size.
An improved version:
SpriteSettingsAuthoringModule.cs:
public void Bake<TAuthoring>(Baker<TAuthoring> baker, TAuthoring authoring, Sprite source, in float4 uvAtlas)
where TAuthoring : Component
{
var authoringTransform = authoring.transform;
var authoringScale = authoringTransform.lossyScale;
baker.BakeSpriteRender
(
baker.GetEntity(TransformUsageFlags.Dynamic),
authoring,
uvAtlas,
GetTilingAndOffsetByDrawMode(),
Pivot,
new float2(source.texture.width, source.texture.height) * uvAtlas.xy / source.pixelsPerUnit * new float2(authoringScale.x, authoringScale.y),
flipX: Flip.x,
flipY: Flip.y
);
}
The baker in SpriteSettingsAuthoringModule.cs calculates the size of a sprite in a very different way than standard unity conventions dictate. The rendered size of a sprite ends up introducing a novel unnecessary scale scalar and ignoring the conventional pixels per unit. This also implicitly assumes that all sprites in a sheet are the same size.
An improved version:
SpriteSettingsAuthoringModule.cs: