diff --git a/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs b/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs index dfc53d09..70acba0e 100644 --- a/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs +++ b/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs @@ -47,6 +47,7 @@ public class auth_createTemplate public List playerList;//玩家列表 public List npcList;//NPC列表 public List materialList;//设备器材列表 + public string disasterLocation;//事故发生地 } public class PlayerList//玩家列表 diff --git a/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs b/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs index 73cd656a..027cd96f 100644 --- a/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs +++ b/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs @@ -31,7 +31,8 @@ public class getPlayerList : MonoBehaviour Debug.Log("获取演练账号列表" + response); // 解析服务器返回的数据 PlayerListResponse playerListResponse = JsonConvert.DeserializeObject(response); - Debug.Log(playerListResponse.data[0].UserName); + Debug.Log(playerListResponse.data[0].UserId); + return playerListResponse; } } diff --git a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs index 4e3bf610..31f71218 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs @@ -22,6 +22,8 @@ public class DatePanel : MonoBehaviour public Text inputText; public Text dataText; public string placeId; + public string disasterLocation; + public string evetId; public Panel panel; public createTemplateInterface createTemplateInterface=new createTemplateInterface(); // Start is called before the first frame update @@ -50,6 +52,8 @@ public class DatePanel : MonoBehaviour public void OnClickSubmitPanel() { createTemplateInfo.Instance.auth_CreateTemplate.sceneId = placeId; + createTemplateInfo.Instance.auth_CreateTemplate.disasterLocation = disasterLocation; + createTemplateInfo.Instance.auth_CreateTemplate.subjectId = evetId; if(preservationToggle.isOn) { createTemplateInfo.Instance.auth_CreateTemplate.isTemplate = "0"; diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index de339dcc..f1999cf9 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -487,7 +487,8 @@ public class EvacuationPanel : Base { JueseChoicePop jueseChoicePop = jueseChoicePanel.GetComponent(); jueseChoicePanel.gameObject.SetActive(true); - jueseChoicePop.SetClass(classLevel.classname.text); + string a = "(" + classLevel.classname.text + ")"; + jueseChoicePop.SetClass(a); //jueseChoicePanel.SetClass(); }); diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 82334a86..f215df1b 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -6,6 +6,7 @@ using Unity.VisualScripting; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; +using static UnityEditor.Progress; public class SelectScenePanel : Base { @@ -216,7 +217,7 @@ public class SelectScenePanel : Base { this.idcidentName = item.incidentText.text; this.idcidentId = item.incidentID; - datePanel.placeId = item.incidentID.ToString(); + string[] difficulty = eventData.Value.Difficulty.Split('|'); string[] roleGroups = eventData.Value.Role.Split('|'); // 分割Role字段,得到多个角色组 @@ -325,7 +326,7 @@ public class SelectScenePanel : Base OnRandomEventClick(); } // 设置模板信息 - createTemplateInfo.Instance.auth_CreateTemplate.subjectId = item.eventId.ToString(); + //createTemplateInfo.Instance.auth_CreateTemplate.subjectId = item.eventId.ToString(); } }); if (toggle.isOn) @@ -437,6 +438,12 @@ public class SelectScenePanel : Base //提交按钮,点击上传数据和隐藏界面 public void SubmitBtn() { + datePanel.evetId = this.eventId.ToString(); + Debug.LogError("datePanel.evetId"+datePanel.evetId); + datePanel.placeId = this.scnenId.ToString(); + Debug.LogError("datePanel.placeId" + datePanel.placeId); + datePanel.disasterLocation = this.idcidentId.ToString(); + Debug.LogError("datePanel.disasterLocation" + datePanel.disasterLocation); SelsctDifficulty(); SetDataPanelInfo(); this.gameObject.SetActive(false); diff --git a/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs b/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs index 0673eeb6..77170f14 100644 --- a/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs +++ b/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using Unity.VisualScripting; +using Unity.VisualScripting.Antlr3.Runtime; using UnityEngine; using UnityEngine.Assertions.Must; using UnityEngine.Networking.Types; @@ -17,11 +18,12 @@ public class JueseChoicePop : MonoBehaviour public GameObject classmatePrefab; public Transform content; - public List classMateList = new List (); + public List classMateList = new List(); // 存储已实例化的 GameObject 列表 private List instantiatedObjects = new List(); // 用于记录已加载的SceneId或者DutyId - HashSet loadedSceneIds = new HashSet(); // 或者使用字典来记录更多信息 + HashSet loadedplayername = new HashSet(); // 或者使用字典来记录更多信息 + HashSet loadedlevel = new HashSet(); // 或者使用字典来记录更多信息 public string s; public JSONReader jsonReader; @@ -38,7 +40,7 @@ public class JueseChoicePop : MonoBehaviour } void Update() { - + } void CLosePop() { @@ -55,84 +57,90 @@ public class JueseChoicePop : MonoBehaviour classItem.isSet = true; //classItem.setClassItem(); } - + //加载分管人员 - public void SetClass(string a) -{ - - - foreach(var all in panel.sceneDataDictionary) + public void SetClass(string a) { - foreach (var info in all.Value) + Debug.LogError("xxxxxxxxxxxxxxxxxxxxxxxxxx" + a); + foreach (var all in panel.sceneDataDictionary) { - Debug.LogError("-------------------------"+ info.sceneId); - LocationData locationData = jsonReader.GetAreaDateById(int.Parse(info.sceneId)); - - if (locationData.Oversee == "-1") + foreach (var info in all.Value) { - Debug.Log($"Skipping ID{info.sceneId}: Oversee is -1."); - continue; // 跳过 - } + Debug.LogError("-------------------------" + info.sceneId); + LocationData locationData = jsonReader.GetAreaDateById(int.Parse(info.sceneId)); - string[] overseeParts = locationData.Oversee.Split(','); - string firstElement = overseeParts[0]; - string lastElement = overseeParts[1]; - - if (overseeParts.Length > 0 && firstElement == info.dutyId && lastElement == "1") - { - Debug.LogError(loadedSceneIds.Contains(info.name)); - // 如果已经加载过,跳过 - if (loadedSceneIds.Contains(info.name)) + if (locationData.Oversee == "-1") { - Debug.Log($"Scene ID {info.sceneId} already loaded. Skipping."); - continue; // 如果该sceneId已经加载过,就跳过 + Debug.Log($"Skipping ID{info.sceneId}: Oversee is -1."); + continue; // 跳过 } + string[] overseeParts = locationData.Oversee.Split(','); + string firstElement = overseeParts[0]; + string lastElement = overseeParts[1]; - // 如果没有加载过,实例化预制体 - GameObject item = GameObject.Instantiate(classmatePrefab, content); - ClassMate classMate = item.GetComponent(); - Button button = item.GetComponent