211
NGUI 3 Support / Changing a sprite in code
« on: May 17, 2012, 11:47:28 PM »
Ok, stupid question alert. How do I change a sprite into another? In code all I want to do is choose another sprite in the atlas.
Put simply, I want something like this.
MyNGUIMenu.GetComponentsInChildren<UISprite>()[0].image = "image2";
This is for a character select screen, I have my window, multiple faces in the atlas, just need to find that last piece of the puzzle to change the face.
Put simply, I want something like this.
MyNGUIMenu.GetComponentsInChildren<UISprite>()[0].image = "image2";
This is for a character select screen, I have my window, multiple faces in the atlas, just need to find that last piece of the puzzle to change the face.


