void Update() { if (alcoholSelected == true) { playerMoveToAlcohol(); } if (alcoholReached == true) { //alcoholRenderer.enabled = false; startSounds.Drink(); //Needs.increaseMyThirst(); //StartCoroutine(IncreaseThirst()); alcoholSelected = false; alcoholReached = false; alcoholDrunk++; StartCoroutine(ShowBACMessage()); SlotMachineDrink[] drinks = PersistentData.GetPlayerStats().GetSlotMachineDrinks(); SlotMachineDrink[] newDrinks = new SlotMachineDrink[drinks.Length + 1]; newDrink.StandardDrinkEquivalence = 1.5f; for (int i = 0; i < drinks.Length; i++) { newDrinks[i] = drinks[i]; } newDrinks[newDrinks.Length - 1] = newDrink; PersistentData.GetPlayerStats().SetSlotMachineDrinks(newDrinks); var CheckDrunk = PersistentData.GetPlayerStats().GetCurrentBAC(); if (CheckDrunk >= 0.3) { TooDrunk.SetActive(true); GameScene.SetActive(false); } //Debug.Log("BAC after: " + PersistentData.GetPlayerStats().GetCurrentBAC()); } }
void Update() { // coffeeRenderer = gameObject.GetComponent<Renderer>(); if (coffeeSelected == true) { playerMoveToCoffee(); } if (coffeeReached == true) { //coffeeRenderer.enabled = false; startSounds.Drink(); Needs.increaseMyThirst(); StartCoroutine(IncreaseThirst()); coffeeSelected = false; coffeeReached = false; coffeeDrunk++; } }