netpyoung / unity.webp

:art: WebP made easy for Unity3d
https://netpyoung.github.io/unity.webp/
MIT License
237 stars 28 forks source link

Added ScriptedImporter for .webp extension #30

Closed hybridherbst closed 2 years ago

hybridherbst commented 2 years ago

This PR slightly changes the package structure (moved existing code to a "Runtime" folder and added an "Editor" folder), and introduces a ScriptedImporter for .webp files that calls the WebP conversion on import and has some minimalistic import options. It also disables the "auto referenced" option from the existing AsmDef because that avoids conflicts with potential other AsmDefs of the same name (it's a very short name).

image

netpyoung commented 2 years ago

Thank you pull request. I didn't notice ScriptedImporter feature. It's cool. and project doens't opened with unchecked "auto referenced" option .

but your opinion about uncheck "auto referenced" option is also reasonable. so I will take a time for how handle that

hybridherbst commented 2 years ago

Hey @netpyoung , I fixed the samples and pushed my changes into this PR :)

Reason: since the AsmDef isn't autoreferenced anymore the samples needed an AsmDef as well so that they can reference the WebP package asmdef.

netpyoung commented 2 years ago

yes I also tested same way for check pr.

Code stripping can be avoid using link.xml

I'm checking how other library's handle that.

hybridherbst commented 2 years ago

AsmDefs are unrelated to code stripping, this PR shouldn't change anything in that regard

netpyoung commented 2 years ago

Um... okay I see. That only bring a dependency to make another asmdef. like d25c93a9fb96974f9848c6fce2120a48e056d5b3 I will think more about this after merge that.

anyway thank you adding cool stuff.