private void OnMouseDown() { if (!isNear) { return; } if (playerManager.handPizza.activeInHierarchy && GetOvenStatus == ovenStatus.empty) { CookPizza(playerManager.handPizza.transform); } else if (GetPizzaStatus != pizzaStatus.notCooked && !playerManager.hasProduct && !playerManager.handPizza.activeInHierarchy) { if (GetPizzaStatus == pizzaStatus.cooked) { cookedPizza.SetActive(true); } else if (GetPizzaStatus == pizzaStatus.burnt) { playerManager.BurntPizza.SetActive(true); } GreenLight.SetActive(false); redLight.SetActive(false); GetOvenStatus = ovenStatus.empty; playerManager.CurrentPizzaIndex = OvenIndex; playerManager.recipeCheckCount = tempCount; StopAllCoroutines(); } }
public void SetLight(Color color) { if (color == Color.red) { Light = LightType.Red; RedLight.SetActive(true); GreenLight.SetActive(false); } if (color == Color.green) { Light = LightType.Green; RedLight.SetActive(false); GreenLight.SetActive(true); } }
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; }