Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kkyu123 opened this issue Sep 18, 2024 · 1 comment

Comments

@kkyu123
Copy link

kkyu123 commented Sep 18, 2024

D2IB$1%Z2250T_E)YD5DS
SW6E7%$S4FO6IBFR1JI)F98
A 1 @$878W%O59%UJVLA4AA
M42TO@J)B4G3PP{UE2$XI

@kkyu123
Copy link
Author

kkyu123 commented Sep 18, 2024

应该要拿到图片设置的的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;);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant