Ejemplo n.º 1
0
    private IEnumerator patientClock()
    {
        yield return(new WaitForSeconds(1));

        currentPatientLevel--;
        Debug.Log($"Patient Level: { currentPatientLevel }");

        float fillAmount = ((float)currentPatientLevel / patientLevel);

        patientLevelProgress.fillAmount = fillAmount;
        patientLevelBG.color            = Color.Lerp(PATIENT_LOW_COLOR, PATIENT_HIGH_COLOR, fillAmount);

        if (currentPatientLevel != 0)
        {
            StartCoroutine(patientClock());
        }

        if (currentPatientLevel == 0)
        {
            AllowedToEntry(false);
            gameplayController.AddPenalty();
        }
    }