// Update is called once per frame void Update() { //internAlarmList = new List<Alarm>(); if (internAlarmList.Count == 0 && GameObject.FindGameObjectWithTag("GlobalSettings") != null && GameObject.FindGameObjectWithTag("GlobalSettings").GetComponent <GlobalSettings>().clientType == GlobalSettings.ClientType.SinglePlayer && GlobalSettings.Instance.filePathJSON != null && GlobalSettings.Instance.filePathJSON.Length > 0) { SerializableScenarioList scenarioList; string json = File.ReadAllText(GlobalSettings.Instance.filePathJSON); scenarioList = JsonUtility.FromJson <SerializableScenarioList>(json); foreach (Alarm alarm in scenarioList.alarms) { Instance.addAlarm(alarm); } } else if (internAlarmList.Count == 0 && GameObject.FindGameObjectWithTag("GlobalSettings") != null && GameObject.FindGameObjectWithTag("GlobalSettings").GetComponent <GlobalSettings>().clientType == GlobalSettings.ClientType.SinglePlayer) { internAlarmList.Add(new Alarm(0, 0, Alarm.MelderType.Melder, "0203/04", "Gaststätte ZWD", "Test", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(1, 0, Alarm.MelderType.Melder, "0203/03", "Gaststätte ZWD", "Test2", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(2, 0, Alarm.MelderType.Melder, "0201/01", "Gaststätte U-E.12", "Test3", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(3, 0, Alarm.MelderType.Melder, "0203/02", "Gaststätte ZWD", "Test4", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(4, 0, Alarm.MelderType.Melder, "0203/01", "Gaststätte ZWD", "Test5", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(5, 0, Alarm.MelderType.Melder, "0202/01", "Gaststätte U-E.12", "Test6", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(6, 0, Alarm.MelderType.Melder, "0202/04", "Gaststätte U-E.12", "Test7", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(7, 0, Alarm.MelderType.Melder, "0202/03", "Gaststätte U-E.12", "Test8", Alarm.AlarmType.Alarm)); internAlarmList.Add(new Alarm(8, 0, Alarm.MelderType.Melder, "0202/02", "Gaststätte U-E.12", "Test9", Alarm.AlarmType.Alarm)); } }
public void manualAlarm() { if (localAlarmList.Count > 0) { alarmList.gameObject.SetActive(true); updateLocalQueue(currentID); alarmList.addAlarm(localAlarmList[currentID]); infoText.text = "Meldung wurde an die BMA gesendet."; } else { addAlarmToLocalQueue(); if (alarmid > 0) { manualAlarm(); alarmid_max = alarmid; } } }
public void RpcSendStringsToServer(Alarm alarm) { alarmList.addAlarm(alarm); }