From 9dd5691c73ab2a4744316e950d6f1cf9d181180b Mon Sep 17 00:00:00 2001 From: lq <3298408835@qq.com> Date: Tue, 24 Dec 2024 18:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=96=8F=E6=95=A3=E4=BA=BA=E7=BE=A4=E5=85=AC?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Scenes/Schedule_03.unity | 91 +++++++++++++++++-- .../Assets/Script/JSONReader/JSONReader.cs | 2 +- xiaofang/Assets/Script/Scheduled_03/Panel.cs | 1 + .../Script/UI/PanelUI/EvacuationPanel.cs | 89 ++++++++++++++---- xiaofang/Assets/yhj/scripts/ClassItem.cs | 34 ------- xiaofang/Assets/yhj/scripts/ClassMate.cs | 44 +-------- xiaofang/Assets/yhj/scripts/JueseChoicePop.cs | 54 ++++++++--- 7 files changed, 198 insertions(+), 117 deletions(-) diff --git a/xiaofang/Assets/Scenes/Schedule_03.unity b/xiaofang/Assets/Scenes/Schedule_03.unity index 91bee2ac..8020f41a 100644 --- a/xiaofang/Assets/Scenes/Schedule_03.unity +++ b/xiaofang/Assets/Scenes/Schedule_03.unity @@ -2184,7 +2184,7 @@ RectTransform: - {fileID: 1435623614} - {fileID: 1120226610} m_Father: {fileID: 1592869153} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -2256,7 +2256,7 @@ RectTransform: - {fileID: 5745561351747452950} - {fileID: 468742197} m_Father: {fileID: 1592869153} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -2920,7 +2920,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3746951257987266719, guid: e55a074b1a79a9045804c800bf094463, type: 3} propertyPath: m_RootOrder - value: 5 + value: 6 objectReference: {fileID: 0} - target: {fileID: 3746951257987266719, guid: e55a074b1a79a9045804c800bf094463, type: 3} propertyPath: m_AnchorMax.x @@ -4091,7 +4091,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3} propertyPath: m_AnchorMax.x @@ -4111,7 +4111,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3} propertyPath: m_SizeDelta.x - value: -764 + value: -1184 objectReference: {fileID: 0} - target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3} propertyPath: m_SizeDelta.y @@ -6201,6 +6201,82 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!1 &1052243736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1052243737} + - component: {fileID: 1052243739} + - component: {fileID: 1052243738} + m_Layer: 5 + m_Name: MainBg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1052243737 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1052243736} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1592869153} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 1.984314} + m_SizeDelta: {x: 0, y: -4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1052243738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1052243736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: d04e5f293a8bded4e9e7a61774178a92, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1052243739 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1052243736} + m_CullTransparentMesh: 1 --- !u!1 &1059189496 GameObject: m_ObjectHideFlags: 0 @@ -9213,6 +9289,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 1052243737} - {fileID: 618256459} - {fileID: 7468736064579811971} - {fileID: 617308872} @@ -13653,7 +13730,7 @@ RectTransform: m_Children: - {fileID: 7318934475829044879} m_Father: {fileID: 1592869153} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -15951,7 +16028,7 @@ RectTransform: - {fileID: 7468736065836200802} - {fileID: 7468736064937661070} m_Father: {fileID: 1592869153} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} diff --git a/xiaofang/Assets/Script/JSONReader/JSONReader.cs b/xiaofang/Assets/Script/JSONReader/JSONReader.cs index 859c28ad..028f8797 100644 --- a/xiaofang/Assets/Script/JSONReader/JSONReader.cs +++ b/xiaofang/Assets/Script/JSONReader/JSONReader.cs @@ -507,7 +507,7 @@ public class LocationData public string Oversee; public string EndPoint; public string RoleLimit; - public int Level; + public string Level; } [System.Serializable] public class EventData diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index f55e3be2..eefa94c8 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -22,6 +22,7 @@ public class SelectedInfo public string sceneId;//场景Id public string dutyId;//职责的Id public string peopleId;//角色Id + public string birthID;//出生地 } public class Panel : Base diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index 28bafdba..a653c667 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -67,7 +67,7 @@ public class EvacuationPanel : MonoBehaviour submitBtn.onClick.AddListener(totalSubmit); StuCountInputField.onEndEdit.AddListener(CheckInput); SetScene(); - SetClass(); + //SetClass(); } void Update() @@ -151,6 +151,7 @@ public class EvacuationPanel : MonoBehaviour Debug.Log($"Scene ID: {kvp.Key}, Assigned NPC Count: {kvp.Value}"); } } + ShowLevel(); } //Npc分配 @@ -253,25 +254,25 @@ public class EvacuationPanel : MonoBehaviour ChangeImage(redistributeBtn.interactable); }); } - foreach (Transform child in sceneCount) - { - Destroy(child.gameObject); - } - // 执行后续的场景级别配置 - LocationData locationData = js.GetAreaDateById(personnelItem.sceneId); - if (locationData.Level.ToString() != "0") - { - GameObject levelItem = GameObject.Instantiate(scenePrefab, sceneCount); - Button levelBtn = levelItem.transform.Find("chooseBtn2").GetComponent