Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Keratos

Pages: [1]
1
Misc Archive / Re: Way to duplicate widget
« on: July 28, 2014, 09:38:17 AM »
Yup, when example button is destroyed none of subgameobjects works.

2
Misc Archive / Way to duplicate widget
« on: July 23, 2014, 02:29:49 PM »
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:

  1.                 int gameId = 0;
  2.                 foreach (Game game in PlayerInfo.currentGames.games) {
  3.                         GameObject nButton = NGUITools.AddChild (GameObject.Find ("ShopGrid"), GameObject.Find ("GameButtonExample"));
  4.                         nButton.name = "GameButton"+gameId;
  5.                         foreach (UIWidget t in nButton.GetComponentsInChildren<UIWidget>()) {
  6.                                 if (t.name != "Background")
  7.                                         t.alpha = 0;
  8.                         }
  9.                         gameId++;
  10.                 }
  11.                 Destroy(GameObject.Find ("GameButtonExample"));

Pages: [1]