From 2f1858484d646cd79dbdaa183ea1b32dbff13055 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Wed, 27 Nov 2024 22:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A2=AB=E7=9B=96=E7=9A=84UI?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20=20=20CTMD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scripts/Address/AddressPanel.cs | 5 +- .../Assets/Scripts/Address/addressItem.cs | 12 +- .../Assets/prefabs/HYLPrefabs/UI.unity | 140 +++++++++--------- .../Assets/prefabs/HYLPrefabs/address.prefab | 2 + .../prefabs/HYLPrefabs/oldAddressPanel.prefab | 1 + 5 files changed, 88 insertions(+), 72 deletions(-) diff --git a/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs b/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs index 1308fa5..3f2b032 100644 --- a/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs +++ b/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs @@ -8,8 +8,11 @@ public class AddressPanel : MonoBehaviour public GameObject addressPrefab; public Transform trans; public GameObject newAdPanelPrefab; + public Transform tran; + public Button newAddressBtn; + void Start() { @@ -19,7 +22,7 @@ public class AddressPanel : MonoBehaviour public void NewAddress() { - GameObject.Instantiate(newAdPanelPrefab,trans); + GameObject.Instantiate(newAdPanelPrefab,tran); } public async void getData() diff --git a/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs b/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs index 48d0957..0b5ba3e 100644 --- a/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs +++ b/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using TMPro; @@ -11,10 +12,19 @@ public class addressItem : MonoBehaviour public TextMeshProUGUI telTxt;//µç»° public Button editBtn;//±à¼­°´Å¥ + public GameObject editPanelPrefab; + public Transform trans; + // Start is called before the first frame update void Start() { - + trans = GameObject.Find("Canvas").transform; + editBtn.onClick.AddListener(Edit); + } + + public void Edit() + { + GameObject.Instantiate(editPanelPrefab, trans); } // Update is called once per frame diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity index 9b3a5bc..398cf98 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity @@ -464,27 +464,27 @@ PrefabInstance: objectReference: {fileID: 4499171977774247193, guid: b7a2ccb5cba723240b3b23ecbfd825e2, type: 3} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 613 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734031970685147, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -349.91998 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032093996524, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_Pivot.x @@ -576,55 +576,55 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7365734032093996531, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} + propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 194 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032134663386, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -349.91998 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 613 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032139323463, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -204.95999 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032285175081, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y @@ -652,99 +652,99 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 194 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734032354904342, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -204.95999 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 613 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033029684611, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -60 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 194 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033068930763, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -494.88 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.x - value: 388 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_SizeDelta.y - value: 120 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.x - value: 194 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7365734033188163814, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} propertyPath: m_AnchoredPosition.y - value: -60 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1fb84dcfa1604bc429f5c3a37ba6d8b0, type: 3} @@ -1494,27 +1494,27 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 870.8313 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 122.7744 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 435.41565 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -462.8004 objectReference: {fileID: 0} - target: {fileID: 2987401724065773185, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_RootOrder @@ -1522,27 +1522,27 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 870.8313 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 122.7744 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 435.41565 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -61.3872 objectReference: {fileID: 0} - target: {fileID: 2987401724360385202, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_fontAsset @@ -1590,51 +1590,51 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 870.8313 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 122.7744 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 435.41565 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -328.996 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 870.8313 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 122.7744 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 435.41565 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -195.19159 objectReference: {fileID: 0} - target: {fileID: 2987401724787116905, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_fontAsset @@ -1666,7 +1666,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724823548005, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724823548006, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_Pivot.x diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/address.prefab b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/address.prefab index e5791fb..374fcb2 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/address.prefab +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/address.prefab @@ -555,6 +555,8 @@ MonoBehaviour: addressTxt: {fileID: 8078615871956852263} telTxt: {fileID: 8078615872677942976} editBtn: {fileID: 8078615871139947805} + editPanelPrefab: {fileID: 1113922771235768985, guid: 0c6b226cae5e67d4d8874104f6549a1b, type: 3} + trans: {fileID: 0} --- !u!1 &8078615872677942978 GameObject: m_ObjectHideFlags: 0 diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/oldAddressPanel.prefab b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/oldAddressPanel.prefab index f99e3d1..39f0245 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/oldAddressPanel.prefab +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/oldAddressPanel.prefab @@ -921,6 +921,7 @@ MonoBehaviour: addressPrefab: {fileID: 8078615872601345300, guid: 15109fc7975ccee44ad1c6a89f0564b5, type: 3} trans: {fileID: 4499171977555058829} newAdPanelPrefab: {fileID: 2987401724823548005, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} + tran: {fileID: 4499171977774247194} newAddressBtn: {fileID: 4499171976461940113} --- !u!114 &4499171977774247195 MonoBehaviour: