void Awake() { buttons = new List <GameObject>(); for (int i = 0; i < transform.childCount; i++) { buttons.Add(transform.GetChild(i).gameObject); ButtonScript bScript = buttons [i].GetComponent <ButtonScript>(); if (bScript != null) { bScript.Initialize(); } } }