IEnumerator loadSubMenuContent(SubMenu subMenu, MenuElement menuElement) { if (!menuElement.IsLoaded){ //Debug.Log("wait 1 sec"); yield return 1; } //Debug.Log("loaded = "+menuElement.IsLoaded); subMenu.populateContent(menuElement); }