private void AdmitPatient(int bedIndex, Bed bed, GameObject patientObject) { Patient patient = patientObject.GetComponent <Patient>(); patientList.Add(bedIndex, patientObject); SnapToBed(bed, patientObject); bed.SetPatient(patient); availableBeds.Remove(bedIndex); patient.ResetTimer(); bed.isOccupied = true; // Send reference to patient to surrounding use zones foreach (Component component in bed.GetComponentsInChildren <UseZoneController>()) { component.GetComponent <UseZoneController>().patient = patient; } // Remove patient from waiting room waitingRoom.RemoveAt(0); }
private void SpawnPatient() { GameObject patientObject = Instantiate(patientPrefab, spawnLocation, Quaternion.identity) as GameObject; patientObject.GetComponent <Patient>().AddSymptom(symptom.GetComponent <Symptom>()); Patient patient = patientObject.GetComponent <Patient>(); patient.inTutorial = true; Bed bed = beds[0]; patientObject.transform.position = bed.transform.position; patientObject.transform.rotation = Quaternion.LookRotation(bed.transform.forward); patientObject.transform.Rotate(new Vector3(-90, 0, 0)); bed.SetPatient(patient); bed.isOccupied = true; foreach (Component component in bed.GetComponentsInChildren <UseZoneController>()) { component.GetComponent <UseZoneController>().patient = patient; } }