Unity-UI-Rounded-Corners icon indicating copy to clipboard operation
Unity-UI-Rounded-Corners copied to clipboard

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

Open Warianos opened this issue 5 years ago • 4 comments

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 ? :)

Warianos avatar Dec 14 '20 11:12 Warianos

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

kirevdokimov avatar Dec 20 '20 22:12 kirevdokimov

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.

kirevdokimov avatar Dec 21 '20 14:12 kirevdokimov

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

shuang852 avatar Jul 17 '21 05:07 shuang852

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

kiteliongames avatar Aug 01 '23 23:08 kiteliongames