diff --git a/xiaofang/Assets/Scenes/Schedule_03333333333.unity b/xiaofang/Assets/Scenes/Schedule_03333333333.unity index 958dae83..12b32797 100644 --- a/xiaofang/Assets/Scenes/Schedule_03333333333.unity +++ b/xiaofang/Assets/Scenes/Schedule_03333333333.unity @@ -10612,7 +10612,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2102021660636739381, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: -361.72 objectReference: {fileID: 0} - target: {fileID: 2102021660636739381, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_SizeDelta.y @@ -10686,6 +10686,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} + propertyPath: js + value: + objectReference: {fileID: 1417128757} - target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: panel value: @@ -10712,19 +10716,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 190.05 objectReference: {fileID: 0} - target: {fileID: 4764228630658219266, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -23.991 objectReference: {fileID: 0} - target: {fileID: 4764228630805767484, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_Name @@ -10732,7 +10736,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764228630805767484, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4764228630805767485, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_Pivot.x @@ -10820,59 +10824,59 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4764228631245731675, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 249.00002 objectReference: {fileID: 0} - target: {fileID: 4764228631278755135, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 629.702 objectReference: {fileID: 0} - target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 133.7755 objectReference: {fileID: 0} - target: {fileID: 4764228631451568083, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -39.08695 objectReference: {fileID: 0} - target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 58.95 objectReference: {fileID: 0} - target: {fileID: 4764228632225803364, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -23.991 objectReference: {fileID: 0} - target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 495.9265 objectReference: {fileID: 0} - target: {fileID: 4764228632238488446, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -39.08695 objectReference: {fileID: 0} - target: {fileID: 9196293257107006892, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_IsActive diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index b3fbdf88..eceeb293 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -1,8 +1,10 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Xml.Serialization; using UnityEngine; using UnityEngine.UI; +using static System.Collections.Specialized.BitVector32; public class EvacuationPanel : MonoBehaviour { @@ -27,6 +29,7 @@ public class EvacuationPanel : MonoBehaviour public GameObject JuesechoicePop; public JueseChoicePop jc = new JueseChoicePop(); + public JSONReader js; [Header("总按钮")] public Button redistributeBtn; @@ -35,9 +38,14 @@ public class EvacuationPanel : MonoBehaviour [Header("Npc数量")] public int npcNum; + [Header("Npc类型")] + public string npcType; + public string roleid; + // Start is called before the first frame update void Start() { + SetNpcType(); jc = JuesechoicePop.GetComponent(); redistributeBtn.onClick.AddListener(ClearData); @@ -53,11 +61,48 @@ public class EvacuationPanel : MonoBehaviour { foreach(var item in createTemplateInfo.Instance.auth_CreateTemplate.npcList) { - + item.userId = npcType; + item.roleId = roleid; } + foreach(var item in createTemplateInfo.Instance.auth_CreateTemplate.playerList) + { + + } + + } + public void SetNpcType() + { + foreach (var scene in panel.sceneDataDictionary) + { + Debug.Log("+++++++++++"); + foreach (var npcData in js.locationDictionary) + { + // 解析角色限制字段 + string roleLimit = npcData.Value.NpcRatio; + + if(npcData.Value.NpcRatio=="-1") + { + continue; + } + else + { + // 先按“,”分隔 + string[] roleLimitSections = roleLimit.Split(','); + if (scene.Key == npcData.Value.Note) + { + // 只有当 scene.Key 和 npcData.Value.Note 匹配时才执行 + this.npcType = roleLimitSections[1]; + roleid = roleLimitSections[0]; + } + } + + } + } + + } diff --git a/xiaofang/Assets/Script/UI/createTemplateInfo.cs b/xiaofang/Assets/Script/UI/createTemplateInfo.cs index a5d83cb4..8218c010 100644 --- a/xiaofang/Assets/Script/UI/createTemplateInfo.cs +++ b/xiaofang/Assets/Script/UI/createTemplateInfo.cs @@ -6,7 +6,6 @@ public class createTemplateInfo : Singleton { public auth_createTemplate auth_CreateTemplate=new auth_createTemplate(); public List playerList;//玩家列表 - public List npcList;//Npc列表 // Start is called before the first frame update void Start() {