-
-
Notifications
You must be signed in to change notification settings - Fork 153
feat(unity): Add support packing multiple type sprite #48
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
base: main
Are you sure you want to change the base?
feat(unity): Add support packing multiple type sprite #48
Conversation
|
Hey @elringus, looks like test requires update license, can you take a look about it? |
Performace regressionLooks like this implementation kinda slow due change from array to list, I'll do fix it for performance. Edit: Maybe not, I need to investigate about this later. Edit: I tried to reduce Edit: I tried to preflight texture's color data before building native texture data(cab7b26), it's now considerably faster then previous implementations before delivering sprites data to native area! |
Exception regressionI fixed it from Edit: Hmm, sometimes it throws exception in This is most likely caused by the asset importer. |
|
The failing workloads should now be fixed on |
50a4360 to
cc4e9c9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 18 5 -13
Lines 856 324 -532
==========================================
- Hits 856 324 -532 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I made this PR turn into draft due needs more fixing regressions. |
|
Hey @elringus, since it's been 2 weeks, I'm pretty busy right now but I think I can take a look into in this weekend. |
|
Guess since |
571dd4c to
cdb61d4
Compare
|
Hey @elringus It's been late from last change.
Also can you give some opinion about my last comment when you have some spare time? |
Hi, thanks for the improvements! I'm not sure I understand the part about the builder SO — could you please elaborate a bit? |
@elringus Since |
|
Still not sure I get it. The editor props are atlas asset props – why would they invalidate during the build? That could only happen if the atlas asset is destroyed, which shouldn't happen during the build. Let's keep this PR focused on adding support for the multiple sprite mode. Please create dedicated issues for other topics so we can discuss them in isolation. |
|
@elringus I think this pr is ready to review, still there's room for improvement of performances (loading from texture) but I'll leave them for now due schedule issue. |
|
It seems the editor tests are failing, likely because some class signatures have changed. We also need to add tests for the new mode to ensure full coverage. I can either keep the PR open or merge into a branch and finish it when I have spare time. |
|
@elringus I see, I'll fix these signatures problem of test codes and adding new multiple type sprite sheets too, when I have some spare time nether... |
|
I figured out why I've didn't noticed test codes, it's outside of package, gonna try some cover up these test code. |
|
Yeah, the Unity tests are quite fragile. This is a legacy from v1, where everything was implemented in C#, and such granular tests were justified, but that's no longer the case. Ideally, we'd make the Unity tests more integration/black-box. Will look into this when I have time. Thank you for the contribution! I'll handle the rest of this. |
|
@elringus Hey but I can send to you my changes at least like below, I'll commit this if you okay to take cover with it.
And also it seems we should take these test code into package area too, |
|
Sure, you can continue committing to this PR. |
|
@elringus Okay, here you go! I've been turned on Allow edits by maintainer so you can directly push my branch at here. |
|
Oh guess I have to rebase first |
9fc7837 to
f8e926d
Compare
…tic state instead of queries This is required because due SerializedProperty are disposed while working on reimport process.
|
@elringus Okay so hope you like it, and want to say thanks for making this package! I can able to reduce 1.22GB memory usage of our game with this package, thank you. |






This PR improves builder in Unity package that makes to supporting Multiple type Sprite Mode in Texture import settings.
This is an improvement to address the current Unity implementation, which treats all Sprites as a single texture and therefore cannot individually pack Sprite resources if Texture's Sprite Mode type is Multiple.
Based on the issue discussion, this should be able to be done by default without any options, so I'm making sure that packing happens naturally internally without requiring any options.
Fixes #47