From 6ee036b478531230bcb637847d4301c9c9351ae9 Mon Sep 17 00:00:00 2001 From: lq <3298408835@qq.com> Date: Mon, 9 Dec 2024 14:12:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=20=E6=95=B0=E6=8D=AE=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Script/Scheduled_03/Panel.cs | 4 +++- xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index 9ce2c113..84730b00 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -96,7 +96,7 @@ public class Panel : MonoBehaviour for (int i = 1; i < panelToggle.Length; i++) { panelToggle[i].interactable = false; - //panelToggle[i].gameObject. + panelToggle[i].gameObject.transform.GetComponent().sprite = toggleImage[0]; } } @@ -367,7 +367,9 @@ public class Panel : MonoBehaviour if(selectScenePanel.isSure) { panelToggle[1].interactable = selectScenePanel.isSure; // 启用第二个Toggle + panelToggle[1].gameObject.transform.GetComponent().sprite = toggleImage[1]; panelToggle[2].interactable = selectScenePanel.isSure; // 启用第三个Toggle + panelToggle[2].gameObject.transform.GetComponent().sprite = toggleImage[1]; panelToggle[3].interactable = selectScenePanel.isSure; // 启用第二个Toggle panelToggle[4].interactable = selectScenePanel.isSure; // 启用第三个Toggle } diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 801dfb2c..53b5921d 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -182,6 +182,7 @@ public class SelectScenePanel : MonoBehaviour if (isSelected) { this.idcidentName = item.incidentText.text; + this.idcidentId = item.incidentID; string[] difficulty = eventData.Value.Difficulty.Split('|'); // 确保difficultyList和difficulty的长度匹配 @@ -264,7 +265,6 @@ public class SelectScenePanel : MonoBehaviour EventData eventData = jsonReader.GetEvenById(this.eventId); foreach (string disasterLocation in incidentIds2) { - //Debug.Log("disasterLocation>>>>>>>"+ disasterLocation); InstantiateIncidentPrefab(int.Parse(disasterLocation)); OnRandomEventClick(); } From 051cfed4541de882d7b257205bd8e17c0c71f9ae Mon Sep 17 00:00:00 2001 From: lq <3298408835@qq.com> Date: Mon, 9 Dec 2024 14:20:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/UI/PanelUI/DatePanel.cs | 4 +++- .../Script/UI/PanelUI/EvacuationPanel.cs | 19 ++++++------------- .../Script/UI/PanelUI/SelectScenePanel.cs | 1 + 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs index 68fb1ace..ca43ed5e 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs @@ -1,3 +1,4 @@ +using JetBrains.Annotations; using System.Collections; using System.Collections.Generic; using TMPro; @@ -19,6 +20,7 @@ public class DatePanel : MonoBehaviour public Text submitText; public Text inputText; public Text dataText; + public int placeId; // Start is called before the first frame update void Start() { @@ -44,7 +46,7 @@ public class DatePanel : MonoBehaviour //提交按钮 public void OnClickSubmitPanel() { - createTemplateInfo.Instance.auth_CreateTemplate.subjectId = PlaceText.text; + createTemplateInfo.Instance.auth_CreateTemplate.subjectId = placeId.ToString(); if (preservationToggle.isOn==true) { submitPanel.gameObject.SetActive(true); diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index 623a5444..3df9768d 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -59,19 +59,12 @@ public class EvacuationPanel : MonoBehaviour public void totalSubmit() { - Debug.Log("----------------->>>>>>>>>>>" + createTemplateInfo.Instance.auth_CreateTemplate.npcList==null); - foreach(var item in createTemplateInfo.Instance.auth_CreateTemplate.npcList) - { - item.userId = npcType; - item.roleId = roleid; - } - - foreach(var item in createTemplateInfo.Instance.auth_CreateTemplate.playerList) - { - - } - - + Debug.Log(createTemplateInfo.Instance.auth_CreateTemplate + "==============="); + NpcList nPC = new NpcList(); + nPC.userId = npcType; + nPC.roleId = roleid; + createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List(); + createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC); } public void SetNpcType() diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 53b5921d..01dd2221 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -183,6 +183,7 @@ public class SelectScenePanel : MonoBehaviour { this.idcidentName = item.incidentText.text; this.idcidentId = item.incidentID; + datePanel.placeId = item.incidentID; string[] difficulty = eventData.Value.Difficulty.Split('|'); // 确保difficultyList和difficulty的长度匹配