public void InitializeMenuItems(DataContainers.Menu iMenu) { for (int i = 0; i < menuScrollContent.childCount; i++) { Debug.Log(menuScrollContent.GetChild(i).name); Destroy(menuScrollContent.GetChild(i).gameObject); } foreach (var food in iMenu.foods) { GameObject go = Instantiate(menuItemPrefab, menuScrollContent); go.GetComponent <Prefabs.MenuItemPrefab>().Initialize(food.Value, mwm); } }
public void setMenu(DataContainers.Menu iMenu) { menu = iMenu; }