Hallo everyone,
I'm trying to exchange the sprite on a UISprite but it does not seem to work.
void Start ()
UISprite uiSpriteCoponent = (UISprite)stagesButtons[i].transform.FindChild("Icon").GetComponent("UISprite");
uiSpriteCoponent.sprite = uiSpriteCoponent.atlas.GetSprite(spriteName);
Debug.Log(uiSpriteCoponent.sprite.name + " VS " + uiSpriteCoponent.spriteName);
gives me this
Country VS Icon_City
What is the difference between UISprite.sprite.name and UISprite.spriteName ?
Maybe its important but this sprite is instantiated in the Start function too , so its the same frame.
Edit: Looks like im doing the wrong aproach... "uiSpriteCoponent.spriteName = spriteName; " is the right way.