Hi guys, I'm looking for a way to duplicate Example buttons in grid and modify them. It's quite easy to do with NGUITools.AddChild but after that i would also like to remove the example button from grid, which seems to be impossible using this way because it breakes all his clones. Thanks in advance for your help.
My currently not working way:
int gameId = 0;
foreach (Game game in PlayerInfo.currentGames.games) {
GameObject nButton = NGUITools.AddChild (GameObject.Find ("ShopGrid"), GameObject.Find ("GameButtonExample"));
nButton.name = "GameButton"+gameId;
foreach (UIWidget t in nButton.GetComponentsInChildren<UIWidget>()) {
if (t.name != "Background")
t.alpha = 0;
}
gameId++;
}
Destroy(GameObject.Find ("GameButtonExample"));