From 2bbc41385c9390c57b880d0a219884fa2240a6a0 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Sun, 24 Nov 2024 00:01:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9CfatherChange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scenes/Battle_Royale.unity | 120 +++++++++--------- TheStrongestSnail/Assets/Scripts/ListPanel.cs | 23 ++++ 2 files changed, 86 insertions(+), 57 deletions(-) diff --git a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity index 8618c20..322e914 100644 --- a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity +++ b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity @@ -300,6 +300,12 @@ MonoBehaviour: toggle2: {fileID: 326865758} panel1: {fileID: 39192267} panel2: {fileID: 508508374} + tog1: {fileID: 922283406} + tog2: {fileID: 1849390903} + parent1: {fileID: 269204434} + parent2: {fileID: 769264874} + Orparent1: {fileID: 400236064} + Orparent2: {fileID: 326865757} --- !u!114 &12243720 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2339,10 +2345,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1043.4, y: -89.5} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &143179106 MonoBehaviour: @@ -3973,10 +3979,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 647.95, y: -312.84} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &245899061 MonoBehaviour: @@ -4188,9 +4194,9 @@ RectTransform: m_Father: {fileID: 12243715} 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} - m_AnchoredPosition: {x: 1.5118, y: -42.9279} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 1.5118, y: -1260.9279} m_SizeDelta: {x: 1315.008, y: 1696.8557} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &253455723 @@ -5816,9 +5822,9 @@ RectTransform: m_Father: {fileID: 582056263} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 691.1493, y: -530.9911} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1306.2986, y: 609.9821} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &384095152 @@ -7241,8 +7247,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -1.5117798, y: 127.86983} - m_SizeDelta: {x: 1369, y: 1441.1083} + m_AnchoredPosition: {x: -1.5117798, y: 127.86981} + m_SizeDelta: {x: 1369, y: 1441.1084} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &508508376 MonoBehaviour: @@ -10834,7 +10840,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.x @@ -10842,7 +10848,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_SizeDelta.x @@ -10882,11 +10888,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.x - value: 684.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.y - value: -327.78 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -11288,9 +11294,9 @@ RectTransform: m_Father: {fileID: 582056263} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 691.15, y: -2325.055} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1306.3, y: 353.7809} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &760515340 @@ -12385,9 +12391,9 @@ RectTransform: m_Father: {fileID: 582056263} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 691.15, y: -2015.7462} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1306.3, y: 172.6165} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &875993942 @@ -19434,7 +19440,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.x @@ -19442,7 +19448,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_SizeDelta.x @@ -19482,11 +19488,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.x - value: 684.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.y - value: -506.06 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -22256,10 +22262,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 647.95, y: -89.5} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1545419445 MonoBehaviour: @@ -23327,10 +23333,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 252.5, y: -312.84} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1589406869 MonoBehaviour: @@ -23829,10 +23835,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 252.5, y: -89.5} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1636140092 MonoBehaviour: @@ -27131,9 +27137,9 @@ RectTransform: m_Father: {fileID: 582056263} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 691.1493, y: -1382.7101} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1306.2986, y: 1001.2359} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1845562840 @@ -27208,10 +27214,10 @@ RectTransform: m_Father: {fileID: 385193887} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1043.4, y: -312.84} - m_SizeDelta: {x: 255, y: 165} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1845977112 MonoBehaviour: @@ -30908,7 +30914,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_AnchorMin.x @@ -30916,7 +30922,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_SizeDelta.x @@ -30956,11 +30962,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_AnchoredPosition.x - value: 691.1493 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_AnchoredPosition.y - value: -2816.912 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1063645489154276223, guid: 4d7d88e5b3da2d84eab98f9d8685014f, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -31005,7 +31011,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.x @@ -31013,7 +31019,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_SizeDelta.x @@ -31053,11 +31059,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.x - value: 684.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_AnchoredPosition.y - value: -149.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3151892671755038174, guid: bf260e5f2fdb1fd4ab4d66d5c75e79a2, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/TheStrongestSnail/Assets/Scripts/ListPanel.cs b/TheStrongestSnail/Assets/Scripts/ListPanel.cs index 3721389..b347867 100644 --- a/TheStrongestSnail/Assets/Scripts/ListPanel.cs +++ b/TheStrongestSnail/Assets/Scripts/ListPanel.cs @@ -12,6 +12,13 @@ public class ListPanel : BasePanel public Toggle toggle2; // 第二个 Toggle public GameObject panel1; // 第一个面板 public GameObject panel2; // 第二个面板 + + public Transform tog1; + public Transform tog2; + public Transform parent1;//蒙板父物体 + public Transform parent2; + public Transform Orparent1;//原始父物体 + public Transform Orparent2; public override void Start() { base.Start(); @@ -30,6 +37,7 @@ public class ListPanel : BasePanel { if (isOn) { + SetMarsk(2); panel1.SetActive(true); panel2.SetActive(false); } @@ -40,6 +48,7 @@ public class ListPanel : BasePanel { if (isOn) { + SetMarsk(1); panel1.SetActive(false); panel2.SetActive(true); } @@ -62,4 +71,18 @@ public class ListPanel : BasePanel { HidePanel(); } + + public void SetMarsk(int i) + { + if (i==1) + { + tog1.SetParent(parent1); + tog2.SetParent(Orparent2); + } + else + { + tog1.SetParent(Orparent1); + tog2.SetParent(parent2); + } + } }