I am currently using the Sprite Library and Sprite Resolver
components on my in-game player object, which has a Sprite Renderer
. This is very useful for swapping out the animation sprites all at once based on the selected character.
I tried doing the same thing on a UI Image
object (which has the Image component rather than a Sprite Renderer
), but the Image
component’s Source Image
does not change when selecting the sprite in the Sprite Resolver
(i.e. the two components don’t appear to be linked in any way).
I was able to do this, although I doubt this was the intended way. My GameObject img has both the Image component and Sprite Renderer components attached. I disable the Sprite renderer through the UI and set the Image sprite to the Sprite Render sprite like this: img.GetComponent<SpriteResolver>().SetCategoryAndLabel(cat, lab); img.GetComponent<Image>().sprite = img.GetComponent<SpriteRenderer>().sprite;
– RoseannaroseanneThanks for the answer, I will try and see if I can get that to work
– GeometricGot it working after a good bit of struggling with the animation controller. Thank you!
– Geometric