IEnumerator OvenTimer() { int i = 0; while (i < 45) { i++; if (i == 30) { GreenLight.SetActive(true); GetPizzaStatus = pizzaStatus.cooked; } yield return(new WaitForSeconds(1f)); } GreenLight.SetActive(false); redLight.SetActive(true); GetPizzaStatus = pizzaStatus.burnt; }
public void CookPizza(Transform pizza) { tempCount = 0; foreach (Transform item in pizza.transform) { if (item.gameObject.activeSelf) { CookedPizzaIngredient[itemCount].SetActive(true); tempCount++; } playerManager.baseProductHand[itemCount].SetActive(false); itemCount++; } itemCount = 0; pizza.gameObject.SetActive(false); GetPizzaStatus = pizzaStatus.notCooked; playerManager.hasProduct = false; StartCoroutine(OvenTimer()); }
private void Start() { GetOvenStatus = ovenStatus.empty; GetPizzaStatus = pizzaStatus.notCooked; playerManager = PlayerManager.instance; }