public void SetContagious() { allowInputs = true; //countdownBar.maxValue = -10; countDown = false; currentState = State.Contagious; HUD.SetActive(true); StartUI.SetActive(false); SickUI.SetActive(false); Sun.gameObject.GetComponent <SunDawn>().SetActive(); TimeCounter.gameObject.GetComponent <TimedownCounter>().SendMessage("SetContinueTime"); InfectionBar.SetActive(false); InfectionStatus.gameObject.GetComponent <Text>().text = "COVID POSITIVO"; InfectionStatus.gameObject.GetComponent <Text>().color = Color.red; playerSpeed = 3; ambient.Play(); }
private void CountDownController() { if (countdownBar.maxValue != refillTime) { //countdownBar.maxValue = refillTime; print(refillTime); } if (countDown) { //Scale the countdown time to go faster than the refill time countdownBar.value += Time.deltaTime / countDownTime * refillTime; } else { // countdownBar.value -= Time.deltaTime / countDownTime * refillTime; } //If we are at 0, start to refill //TO DO: change according to selling status if (countdownBar.value <= 0) { countDown = false; //allowInputs = false; } else if (countdownBar.value >= refillTime && countDown) { countDown = false; currentState = State.NotActive; SickUI.SetActive(true); TimeCounter.gameObject.GetComponent <TimedownCounter>().SendMessage("SetStopTime"); threshold_money = threshold_money + 500 * (currentLevelInt + 1); totalmoney.text = threshold_money.ToString(); ambient.Pause(); coins.Pause(); coinsEmitter.Stop(); moving.Stop(); alarm.Stop(); VirusEmitter.enableEmission = true; VirusEmitter.Play(); contagiusBool = true; } }