3 using System.Collections;
4 using System.Collections.Generic;
18 public GameObject LoadingScreenWidget;
19 public GameObject TextPatientName;
21 private Text mTextPatientName;
23 private List<string> activeJobs =
new List<string>();
29 mTextPatientName = TextPatientName.GetComponent<Text> ();
32 PatientEventSystem.startListening (PatientEventSystem.Event.PATIENT_StartLoading,
34 PatientEventSystem.startListening (PatientEventSystem.Event.LOADING_AddLoadingJob,
36 PatientEventSystem.startListening (PatientEventSystem.Event.LOADING_RemoveLoadingJob,
41 void loadingStarted(
object obj )
45 if (patientEntry != null) {
46 mTextPatientName.text = patientEntry.name;
50 LoadingScreenWidget.SetActive (
true);
53 void addLoadingJob(
object obj )
55 if (!LoadingScreenWidget.activeSelf)
58 string msg = obj as string;
64 void removeLoadingJob(
object obj )
66 if (!LoadingScreenWidget.activeSelf)
69 string msg = obj as string;
71 if (activeJobs.Contains (msg)) {
72 activeJobs.Remove (msg);
78 if (activeJobs.Count <= 0) {
79 LoadingScreenWidget.SetActive (
false);
82 PatientEventSystem.triggerEvent( PatientEventSystem.Event.PATIENT_FinishedLoading );
88 foreach(
string s
in activeJobs )
90 info += s +
": Loading\n";