GetComponent<UISprite>().spriteName = spriteName;
gameObject.SetActive(true);
I have a disabled game object with UISprite & UIButton scripts on it. I'm setting a new sprite for it as above, but when I set it active, UIButton reverts the sprite again. Is this an intentional behaviour? Should I set both UISprite & UIButton sprites if the game object has both of them?