private void Start() { _expandables = GetComponentsInChildren <IExpandableUIElement>(true); for (int i = 0; i < _expandables.Length; i++) { ExpandableSidebarElement sidebarElement = _expandables[i] as ExpandableSidebarElement; sidebarElement.Init(); sidebarElement.GetComponent <Button>().onClick.AddListener(() => toggle(sidebarElement)); sidebarElement.DummyButton.onClick.AddListener(() => toggle(sidebarElement)); } }