diff --git a/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs b/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs index 500c9751..2507fd17 100644 --- a/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs +++ b/xiaofang/Assets/Script/DirllInterface/createTemplateInterface.cs @@ -60,7 +60,8 @@ public class NpcList//NPC { public string npcId;//NPC编号--------------------------------必须 public string areaId;//区域编号------------------------------必须 - public int birthAreaId;//数量--------------------------------必须 + public int num;//数量--------------------------------必须 + public int isHere;//是否归属 } public class MaterialList//设备器材列表 { diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index 0bc3d55b..f8f19e97 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -327,7 +327,6 @@ public class Panel : MonoBehaviour string difficultyId = roleLimits[1]; string roleId = roleLimits[2]; // 职业ID int minRequired = int.Parse(roleLimits[3]); // 最低要求人数 -Debug.LogError("SceneId+" + selectScenePanel.idcidentId); if (accidentLocationId == selectScenePanel.idcidentId.ToString() && roleId == id.ToString() && difficultyId == selectScenePanel.difficultyId.ToString()) { GameObject item = GameObject.Instantiate(scenePrefab, sceneCount); @@ -486,7 +485,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId); selectedInfo.name = name; selectedInfo.peopleId = peopleItem.peopleId; isPersonSelected = true; // 选择了人员 - Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.peopleId); } else if (buttonText != null && buttonText.tag == Tags.scene) // 获取标签为场景的信息 { @@ -495,7 +493,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId); selectedInfo.scene = scene; selectedInfo.sceneId= sceneItem.sceneId; isSceneSelected = true; // 选择了场景 - Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.sceneId); } else if (buttonText != null && buttonText.tag == Tags.duty) // 获取标签为职责的信息 { @@ -514,7 +511,6 @@ Debug.LogError("SceneId+" + selectScenePanel.idcidentId); dutyId = item.dutyId; selectedInfo.duty = duty; selectedInfo.dutyId = dutyId.ToString(); - Debug.LogError(">>>>>>>>>>>>>>>>" + selectedInfo.dutyId); } } } diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index 82a5b759..db2d6181 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -60,7 +60,8 @@ public class EvacuationPanel : MonoBehaviour // Start is called before the first frame update void Start() { - SetNpcType(); + redistributeBtn.interactable = false; + //SetNpcType(); //nonZeroAreas= GetNonZeroNpcRatioAreas(); jc = JuesechoicePop.GetComponent(); CountsubmitBtn.onClick.AddListener(Submit); @@ -79,12 +80,18 @@ public class EvacuationPanel : MonoBehaviour //上传数据 public void totalSubmit() { - NpcList nPC = new NpcList(); - - nPC.npcId = npcType; - nPC.areaId = roleid; createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List(); - createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC); + foreach(var npcInfo in personnelItems) + { + Debug.LogError("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + NpcList nPC = new NpcList(); + nPC.npcId = npcInfo.npcId.ToString(); + nPC.areaId = npcInfo.sceneId.ToString(); + nPC.isHere=npcInfo.isHere; + nPC.num = npcInfo.NpcNum; + + createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC); + } panel.panelToggle[3].interactable = true; // 启用第二个Toggle panel.panelToggle[3].gameObject.transform.GetComponent().sprite = panel.toggleImage[1]; panel.panelToggle[4].interactable = true; // 启用第三个Toggle @@ -143,6 +150,7 @@ public class EvacuationPanel : MonoBehaviour { item.SetInfo(kvp.Value.ToString()); // 更新UI显示 item.NpcNum = kvp.Value; // 更新Npc数量 + item.personnelImage.gameObject.SetActive(true); // 显示图标 Debug.Log($"Scene ID: {kvp.Key}, Assigned NPC Count: {kvp.Value}"); } @@ -168,7 +176,8 @@ public class EvacuationPanel : MonoBehaviour { int sceneId = item.sceneId; // 使用 PersonnelItem 的 sceneId float ratio = float.Parse(parts[4]); // 第五项是分配比例 - + item.npcId = int.Parse(parts[2]); + item .isHere=int.Parse(parts[3]); if (!sceneRatios.ContainsKey(sceneId)) { sceneRatios.Add(sceneId, ratio); @@ -400,7 +409,6 @@ public class EvacuationPanel : MonoBehaviour } } - //设置文字颜色 public void OnSceneItemClicked(GameObject clickedItem, Color color, GameObject select) { diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 8a149b42..a1f5c5ae 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -383,7 +383,6 @@ public class SelectScenePanel : MonoBehaviour toggle.isOn = false; } } - Debug.Log("=++++++++++++++++++++++=" + eventToggleList[randomIndex].GetComponent()); // 选中随机事件 if (eventToggleList[randomIndex] != null && eventToggleList[randomIndex].GetComponent().isOpen != false) { diff --git a/xiaofang/Assets/Script/UI/PersonnelItem.cs b/xiaofang/Assets/Script/UI/PersonnelItem.cs index 71aced06..520bf19b 100644 --- a/xiaofang/Assets/Script/UI/PersonnelItem.cs +++ b/xiaofang/Assets/Script/UI/PersonnelItem.cs @@ -8,6 +8,7 @@ public class PersonnelItem : MonoBehaviour public Text sceneText; public Image personnelImage; public Text personnelNum; + public int npcId; public int sceneId; public int Num = 0; public int NpcNum = 0;