public Ingredient_Full(Recipe.Ingredient ri) { ingr = ri; if (ri != Recipe.Ingredient.Burger && ri != Recipe.Ingredient.Chopped_Onion && ri != Recipe.Ingredient.Chopped_Mushroom) { cookValue = -1; } else { cookValue = 0; } }
public void ConfigureScreen(Recipe.Ingredient ingredient, Recipe recipe) { ClearMaterialToggles(); activeIngredient = ingredient; activeRecipe = recipe; activeMass = ingredient.amount; List <Tag> list = new List <Tag>(); foreach (Element element in ElementLoader.elements) { if (element.IsSolid && (element.tag == ingredient.tag || element.HasTag(ingredient.tag))) { list.Add(element.tag); } } foreach (Tag materialBuildingElement in GameTags.MaterialBuildingElements) { if (materialBuildingElement == ingredient.tag) { foreach (GameObject item in Assets.GetPrefabsWithTag(materialBuildingElement)) { KPrefabID component = item.GetComponent <KPrefabID>(); if ((Object)component != (Object)null && !list.Contains(component.PrefabTag)) { list.Add(component.PrefabTag); } } } } foreach (Tag item2 in list) { if (!ElementToggles.ContainsKey(item2)) { GameObject gameObject = Util.KInstantiate(TogglePrefab, LayoutContainer, "MaterialSelection_" + item2.ProperName()); gameObject.transform.localScale = Vector3.one; gameObject.SetActive(true); KToggle component2 = gameObject.GetComponent <KToggle>(); ElementToggles.Add(item2, component2); component2.group = toggleGroup; ToolTip component3 = gameObject.gameObject.GetComponent <ToolTip>(); component3.toolTip = item2.ProperName(); } } RefreshToggleContents(); }