From c28cca2d95021bc58baa57f3f1119ef89c43dcd0 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Sun, 1 Dec 2024 22:24:03 +0800 Subject: [PATCH] =?UTF-8?q?UI=E9=80=BB=E8=BE=91bug=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=8C=E5=87=86=E5=A4=87=E6=8E=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...03333.unity => Schedule_03333333333.unity} | 114 +++--------------- ...y.meta => Schedule_03333333333.unity.meta} | 2 +- .../Script/UI/PanelUI/EvacuationPanel.cs | 14 ++- xiaofang/Assets/yhj/scripts/ClassMate.cs | 25 +++- xiaofang/Assets/yhj/scripts/JueseChoicePop.cs | 29 ++++- 5 files changed, 78 insertions(+), 106 deletions(-) rename xiaofang/Assets/Scenes/{Schedule_03333.unity => Schedule_03333333333.unity} (99%) rename xiaofang/Assets/Scenes/{Schedule_03333.unity.meta => Schedule_03333333333.unity.meta} (74%) diff --git a/xiaofang/Assets/Scenes/Schedule_03333.unity b/xiaofang/Assets/Scenes/Schedule_03333333333.unity similarity index 99% rename from xiaofang/Assets/Scenes/Schedule_03333.unity rename to xiaofang/Assets/Scenes/Schedule_03333333333.unity index 1845d496..13ff75d2 100644 --- a/xiaofang/Assets/Scenes/Schedule_03333.unity +++ b/xiaofang/Assets/Scenes/Schedule_03333333333.unity @@ -3557,11 +3557,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7e8b72074fc60764b8554d7067527809, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!224 &825373660 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 51007377463830339, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - m_PrefabInstance: {fileID: 1799705458} - m_PrefabAsset: {fileID: 0} --- !u!1001 &856136726 PrefabInstance: m_ObjectHideFlags: 0 @@ -5655,6 +5650,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 618256459} m_Modifications: + - target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + propertyPath: title + value: + objectReference: {fileID: 865567722} - target: {fileID: 7468736063766935910, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} propertyPath: MainPanel value: @@ -6114,6 +6113,17 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 7468736063766935915, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} m_PrefabInstance: {fileID: 865567720} m_PrefabAsset: {fileID: 0} +--- !u!114 &865567722 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 7468736064578063281, guid: 90919b88a71f0054bb1cf84429cb3a1e, type: 3} + m_PrefabInstance: {fileID: 865567720} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &911824229 GameObject: m_ObjectHideFlags: 0 @@ -8716,7 +8726,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &1417128757 MonoBehaviour: m_ObjectHideFlags: 0 @@ -10514,46 +10524,6 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 618256459} m_Modifications: - - target: {fileID: 51007377463830339, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_SizeDelta.x - value: 8.122314 - objectReference: {fileID: 0} - - target: {fileID: 51007377463830339, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 51007377463830342, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_VerticalFit - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 51007377463830342, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_HorizontalFit - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 370120539392972246, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchoredPosition.y - value: -0.000014001576 - objectReference: {fileID: 0} - - target: {fileID: 380336514535910973, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 380336514535910973, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1662720451953426838, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_Content - value: - objectReference: {fileID: 825373660} - - target: {fileID: 1662720451953426838, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_Horizontal - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1662720451953426838, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_MovementType - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2102021659995593758, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -10690,10 +10660,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 2102021661112157380, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_Horizontal - value: 0 - objectReference: {fileID: 0} - target: {fileID: 2102021661231301985, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -10718,22 +10684,6 @@ PrefabInstance: propertyPath: jsonReader value: objectReference: {fileID: 1417128757} - - target: {fileID: 2658781182633319536, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2658781182633319536, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4051613669538919690, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4051613669538919690, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchoredPosition.y - value: -8.5 - objectReference: {fileID: 0} - target: {fileID: 4764228630647718977, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -10862,10 +10812,6 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 249.00002 objectReference: {fileID: 0} - - target: {fileID: 4764228631278755134, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - target: {fileID: 4764228631278755135, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_SizeDelta.x value: 629.702 @@ -10918,34 +10864,6 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: -39.08695 objectReference: {fileID: 0} - - target: {fileID: 5097990001440067949, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 5837674814315639197, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5837674814315639197, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5837674814315639197, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7538115214979638682, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7538115214979638682, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7538115214979638682, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - target: {fileID: 9196293257107006892, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3} propertyPath: m_IsActive value: 0 diff --git a/xiaofang/Assets/Scenes/Schedule_03333.unity.meta b/xiaofang/Assets/Scenes/Schedule_03333333333.unity.meta similarity index 74% rename from xiaofang/Assets/Scenes/Schedule_03333.unity.meta rename to xiaofang/Assets/Scenes/Schedule_03333333333.unity.meta index f5d1c999..f84d85a4 100644 --- a/xiaofang/Assets/Scenes/Schedule_03333.unity.meta +++ b/xiaofang/Assets/Scenes/Schedule_03333333333.unity.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d2b637663b3f5db4fa358637e1e18f67 +guid: a73dbc35051d4614a8e27d92a0830665 DefaultImporter: externalObjects: {} userData: diff --git a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs index 08ff71ea..111279b2 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/EvacuationPanel.cs @@ -14,6 +14,7 @@ public class EvacuationPanel : MonoBehaviour public Text topText; public List classItemList = new List(); + public List classMateList = new List(); [Header("ѧÉúÊýÁ¿")] public InputField StuCountInputField; @@ -50,11 +51,22 @@ public class EvacuationPanel : MonoBehaviour private void ClearData() { - foreach(var item in classItemList) + jc.classItem.isSet = false; + foreach (var item in classItemList) { item.isSet = false; item.setClassItem(""); } + + jc.classMate.isBeSet = false; + + foreach(var item in jc.classMateList) + { + item.isBeSet = false; + item.setName(); + } + + } // Update is called once per frame diff --git a/xiaofang/Assets/yhj/scripts/ClassMate.cs b/xiaofang/Assets/yhj/scripts/ClassMate.cs index d552031b..1c988a1b 100644 --- a/xiaofang/Assets/yhj/scripts/ClassMate.cs +++ b/xiaofang/Assets/yhj/scripts/ClassMate.cs @@ -8,19 +8,33 @@ public class ClassMate : MonoBehaviour { public JueseChoicePop jueseChoicePop; public Text classmatename; - + public string s; public Button otherButton; public Button button; + + public bool isClear = false; + + public bool isBeSet = false; + // Start is called before the first frame update void Start() { button.onClick.AddListener(Click); + s = classmatename.text; } public void Click() { - jueseChoicePop.SetClassMate(this); - //classmatename.text += + if(isBeSet == false) + { + jueseChoicePop.SetClassMate(this); + } + else + { + jueseChoicePop.ChangeClassMate(); + } + + } public void SetJc(JueseChoicePop jc) @@ -28,6 +42,11 @@ public class ClassMate : MonoBehaviour jueseChoicePop = jc; } + public void setName() + { + classmatename.text = s; + } + // Update is called once per frame void Update() { diff --git a/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs b/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs index 2d66307b..0b988ffe 100644 --- a/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs +++ b/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; @@ -12,6 +13,10 @@ public class JueseChoicePop : MonoBehaviour public Button Surebtn; public GameObject classmatePrefab; public Transform content; + + public List classMateList = new List (); + + //public string s; // Start is called before the first frame update void Start() { @@ -44,10 +49,12 @@ public class JueseChoicePop : MonoBehaviour { for (int i = 0; i < 10; i++) { - GameObject item = GameObject.Instantiate(classmatePrefab, content); + ClassMate classMate = item.GetComponent(); + classMateList.Add(classMate); classMate.SetJc(this); + } } @@ -57,11 +64,27 @@ public class JueseChoicePop : MonoBehaviour } - public void SetClassMate(ClassMate classMate) + public void SetClassMate(ClassMate classMate,string a = "") { + classMate.isBeSet = true; classItem.isSet = true; this.classMate = classMate; classItem.setClassItem(classMate.classmatename.text); - classMate.classmatename.text = classMate.classmatename.text + "(" + classItem.classname.text + ")"; + //s = classMate.classmatename.text; + this.classMate.classmatename.text = classMate.classmatename.text + "(" + classItem.classname.text + ")"; + + } + + public void ClearClassMate() + { + } + + + public void ChangeClassMate() + { + + } + + }