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

Does not work with sprites with type = Multiple with sprite editor #13

Open
Warianos opened this issue Dec 14, 2020 · 4 comments
Open

Comments

@Warianos
Copy link

This works with single Sprites but if i go and drag a sprite resulted from a sprite editor slicing operation it does not work :(

I may be doing something wrong, could you help me out ? :)

@kirevdokimov
Copy link
Owner

I have done some research. Unfortunately it works not as I expected. Unity Sprite Editor impact to some internal things that squeeze UV of the image, so I cannot control it. What can I say is my shaders are not compatible with sprite editor.

If someone in future will get how to solve it, feel free to pull-request!

This is how Unity squeeze uv. I just replaced return color with return float4((i.uv.x * 100) % 5, 0, (i.uv.y * 100) % 5,1); to get that rows and columns
111

This is how it looks like with color. The corners are distracted because it depends on UV.
222

@bronydell bronydell mentioned this issue Dec 21, 2020
@kirevdokimov
Copy link
Owner

Oh I see I didn't get your question right. I need to review pull request #14. So check if this works just fine for you @Warianos.

@shuang852
Copy link

I tried downloading the code from #14 and replaced the code for UiRoundedCorner, even removing the UiRoundedCorner and downloading the code. #14 doesn't solve the problem..., seems like the material only cares about the origin of the latest image and causes anything that has that material to have different origins.

There is a workaround but extremely tedious and becomes pointless, you can create new material for each sprite with PR#14 code and it'll work with multiple sprites.

image

@kiteliongames
Copy link

@shuang852 @Warianos How did you get this working for sprites?

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

4 participants