Question by
LandePlage · May 07, 2017 at 05:44 PM ·
spritecolorspriterendererdropdown
Get SpriteRenderer from Sprite?
I have a Sprite-component, but I need to get its SpriteRenderer component. Is there a way to do this based on the Sprite?
This has to do with having set up Unity's own UI dropdown-object, and adding one white sprite to each DropdownOption. I then want to color each of them a specific color when the game starts. I can access each option's "Image" (which is actually a sprite-component), but haven't found a way to tint each sprite.
Comment
Your answer
Follow this Question
Related Questions
Sprite not properly updating color 0 Answers
MissingFieldException: UnityEngine.SpriteRenderer.sprite 0 Answers
Get sprite size and position 0 Answers