Example #1
0
 void RefreshButtons()
 {
     Utils.RemoveAllChildsIn(container);
     foreach (AmiScript amiScript in CharacterData.Instance.characterScripts.scripts)
     {
         UIButtonInGame newButton = Instantiate(buttonInGame);
         newButton.transform.SetParent(container);
         newButton.transform.localScale = Vector3.one;
         newButton.Init(this, amiScript);
     }
     UIButtonInGame[] buttons = container.gameObject.GetComponentsInChildren <UIButtonInGame> ();
     if (buttons.Length > 0)
     {
         SetSelected(buttons [buttons.Length - 1]);
     }
 }