diff --git a/xiaofang/Assets/Prefabs/itemPrefabs/personnelSceneitem.prefab b/xiaofang/Assets/Prefabs/itemPrefabs/personnelSceneitem.prefab index a6a800e6..256ee808 100644 --- a/xiaofang/Assets/Prefabs/itemPrefabs/personnelSceneitem.prefab +++ b/xiaofang/Assets/Prefabs/itemPrefabs/personnelSceneitem.prefab @@ -641,7 +641,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 560.5, y: -44} + m_AnchoredPosition: {x: 560.5, y: -109} m_SizeDelta: {x: 1121, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &5900002971599260725 diff --git a/xiaofang/Assets/Scenes/Schedule_03.unity b/xiaofang/Assets/Scenes/Schedule_03.unity index 9fe01cfd..d7c03a9d 100644 --- a/xiaofang/Assets/Scenes/Schedule_03.unity +++ b/xiaofang/Assets/Scenes/Schedule_03.unity @@ -2253,6 +2253,11 @@ MonoBehaviour: jsonReader1: {fileID: 1417128757} selectScenePanel: {fileID: 7468736064579811982} datePanel: {fileID: 468742199} +--- !u!1 &621287106 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 51007377463830338, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} + m_PrefabInstance: {fileID: 1799705458} + m_PrefabAsset: {fileID: 0} --- !u!1 &625672672 GameObject: m_ObjectHideFlags: 0 @@ -10132,6 +10137,14 @@ PrefabInstance: propertyPath: jsonReader value: objectReference: {fileID: 1417128757} + - target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} + propertyPath: sceneCount + value: + objectReference: {fileID: 621287106} + - target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} + propertyPath: scenePrefab + value: + objectReference: {fileID: 6833246911785287183, guid: eec456cfeada31d4b84c2ba45b21163e, type: 3} - target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: selectScene value: diff --git a/xiaofang/Assets/Scenes/main.unity b/xiaofang/Assets/Scenes/main.unity index 44189e78..9fe01cfd 100644 --- a/xiaofang/Assets/Scenes/main.unity +++ b/xiaofang/Assets/Scenes/main.unity @@ -10174,7 +10174,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 diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index 6c46ec64..9ab9afca 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -18,7 +18,9 @@ public class EvacuationPanel : MonoBehaviour public Panel panel; public GameObject personnelPrefabs; public GameObject classPrefab; - public GameObject classCount; + public GameObject classCount;// + public GameObject scenePrefab;//区域预制体 + public GameObject sceneCount;//区域预制体的容器 public Transform content; public Text topText; private GameObject selectedScene = null;//当前选中场景 @@ -319,7 +321,7 @@ public class EvacuationPanel : MonoBehaviour button.onClick.AddListener(() => { OnSceneItemClicked(item, Color.yellow, selectedScene); - + LoadManagedArea(selectScene.difficultyId, personnelItem.sceneId); }); //Debug.Log("New PersonnelItem created. SceneId: " + personnelItem.sceneId + ", Num: " + personnelItem.Num); personnelItems.Add(personnelItem); @@ -353,6 +355,7 @@ public class EvacuationPanel : MonoBehaviour // 调试输出 Debug.Log($"Redistribute button is {(canRedistribute ? "enabled" : "disabled")}"); } + //判断输入框的数字是否大于1 void CheckInput(string input) { @@ -367,6 +370,8 @@ public class EvacuationPanel : MonoBehaviour } } } + + //Npc数量设置按钮置灰设置 public void Countsubmit() { //按钮置灰 @@ -493,4 +498,29 @@ public class EvacuationPanel : MonoBehaviour } } + //动态加载分管区域预制体 + public void LoadManagedArea(int targetKey,int sceneId) + { + // 确保字典中有数据 + if (selectScene.difficultyToRoles.Count == 0) + { + Debug.Log("The dictionary is empty."); + return; + } + // 判断字典中是否包含目标Key + if (selectScene.difficultyToRoles.ContainsKey(targetKey)) + { + // 获取目标Key对应的Value值 + List roles = selectScene.difficultyToRoles[targetKey]; + foreach (var role in roles) + { + //if(sceneId=) + } + } + else + { + Debug.Log($"The key {targetKey} does not exist in the dictionary."); + } + } + }