liangxiegame / QFramework

Godot/Unity3D System Design Architecture
https://qframework.cn
MIT License
4.47k stars 780 forks source link

在unity将图片的pixelsPerUnit设置成16,但用ResLoader加载出来的图片的pixelsPerUnit还是100 #139

Open kkyu123 opened 2 months ago

kkyu123 commented 2 months ago

D2IB$1%Z`2250T_E)YD5D`S SW6E7%$S4FO6IBFR1JI)F98 A 1 @$878W%O59%UJVLA4AA M4~2TO@J)B4G3PP{UE~2$XI

kkyu123 commented 2 months ago

应该要拿到图片设置的的spritePixelsPerUnit传进去 var importer = AssetImporter.GetAtPath(assetPath) as TextureImporter; var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f, importer.spritePixelsPerUnit;);