예제 #1
0
    public void BuyBandaid()
    {
        Patient patient = GameObject.Find("Local").GetComponent <Patient>();

        if (patient.roomID > 0)
        {
            Doctor doctor = GlobalVariables.doctorList.Find(x => x.doctorID == patient.roomID);
            if (patient.money >= doctor.bandaidPrice && patient.cure == Patient.Cure.None)
            {
                doctor.BandaidSold();
                patient.cure               = Patient.Cure.Bandaid;
                patient.money             -= doctor.bandaidPrice;
                patient.roomID             = 0;
                patient.transform.position = new Vector3(0f, 0f, 0f);
            }
            patient.cured.text = "Treated: " + patient.cure.ToString();
            EnableDisableButtons(false);
        }
    }