public void returnToEmpty() { foreach (GameObject g in gameObjects) { g.SetActive(false); } gameObjects[0].SetActive(true); potState = potState.EMPTY; isReady = false; currentFoods.Clear(); totalTime = 0f; currentTime = 0f; totalBurningTime = 0f; currentBurningTime = 0f; for (int i = 0; i < cook.iconCanvas.transform.childCount; i++) { Image image = cook.iconCanvas.transform.GetChild(i).GetComponent <Image>(); image.sprite = addIngredientIcon.sprite; } cook.imageStatus.sprite = cook.statusCanvas.none; cook.setforegroundImageAmount(0f); foreach (Transform child in parent.transform) { GameObject.Destroy(child.gameObject); } }
public void addFood(Food food) { Debug.Log("agregando comida"); Sprite icon = food.getImage(); changeIcon(currentFoods.Count, icon); setParent(food); currentFoods.Add(food); totalTime += food.currentState.processingTime - 3 * getListCount(); if (currentFoods.Count == 1) { if (food.getType() == FoodType.TOMATO) { potState = potState.TOMATOED; } else if (food.getType() == FoodType.ONION) { potState = potState.ONIONED; } else if (food.getType() == FoodType.MUSHROM) { potState = potState.MUSHROOMED; } changePotState(); } }
public void setPlateContent(potState potState) { desactivateAllPlates(); if (potState == potState.TOMATOED) { setActive(1); plateContent = plateContent.TOMATO; } else if (potState == potState.ONIONED) { setActive(2); plateContent = plateContent.ONION; } else if (potState == potState.MUSHROOMED) { setActive(3); plateContent = plateContent.MUSHROOM; } }