void InitUI() { skillButtons = new SkillButton[skillCount]; for (int i = 0; i < skillCount; i++) { SkillButton newButton = skillPanel.transform.GetChild(i).GetComponent <SkillButton>(); newButton.Init(); skillButtons[i] = newButton; } itemButtons = new ItemButton[itemCount]; for (int i = 0; i < itemCount; i++) { ItemButton newButton = itemPanel.transform.GetChild(i).GetComponent <ItemButton>(); newButton.Init(); itemButtons[i] = newButton; } UpdateItemButtons(); }