From c7ae9cac51fd49b1982471b9bddaaed6129fd00c Mon Sep 17 00:00:00 2001 From: LMZ <1477077658@qq.com> Date: Thu, 26 Dec 2024 22:30:20 +0800 Subject: [PATCH] GGGGGGGGGGGGGGGGGGGGGGGGGGGG --- .../Prefabs/PanelPrefabs/OpcOrder2 1.prefab | 18 +- xiaofang/Assets/Scenes/HylScene/Test.unity | 359 ++++++++++++++++++ .../Assets/Script/UI/ZZZZZZ/Chooselitem8.cs | 4 + xiaofang/Assets/Script/UI/ZZZZZZ/OpcOrder2.cs | 40 +- 4 files changed, 408 insertions(+), 13 deletions(-) diff --git a/xiaofang/Assets/Prefabs/PanelPrefabs/OpcOrder2 1.prefab b/xiaofang/Assets/Prefabs/PanelPrefabs/OpcOrder2 1.prefab index 002ddd37..b4675d12 100644 --- a/xiaofang/Assets/Prefabs/PanelPrefabs/OpcOrder2 1.prefab +++ b/xiaofang/Assets/Prefabs/PanelPrefabs/OpcOrder2 1.prefab @@ -20,7 +20,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &46083687380014704 RectTransform: m_ObjectHideFlags: 0 @@ -41,7 +41,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 353.025, y: 188} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 101, y: 203.15999} m_Pivot: {x: 0.5, y: 1} --- !u!114 &2166922752449803930 MonoBehaviour: @@ -157,7 +157,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &46083687645065382 RectTransform: m_ObjectHideFlags: 0 @@ -177,7 +177,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: 203.05, y: -155.06} + m_AnchoredPosition: {x: 203.04999, y: -155.06} m_SizeDelta: {x: 344.1, y: 96.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &823124465897836687 @@ -559,6 +559,8 @@ MonoBehaviour: contentTransform: {fileID: 46083687380014704} jsonReader: {fileID: 6827591438678571860, guid: 327c725927f3f924d8923cc19bc83385, type: 3} ItemList: [] + name: + hylCS: {fileID: 0} --- !u!114 &5472433620249075691 MonoBehaviour: m_ObjectHideFlags: 0 @@ -650,10 +652,10 @@ RectTransform: m_Father: {fileID: 46083687380014704} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - 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_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 203.05, y: -48.1} + m_SizeDelta: {x: 344.1, y: 96.2} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4602151241506608 CanvasRenderer: diff --git a/xiaofang/Assets/Scenes/HylScene/Test.unity b/xiaofang/Assets/Scenes/HylScene/Test.unity index 611b5c3f..34cc6851 100644 --- a/xiaofang/Assets/Scenes/HylScene/Test.unity +++ b/xiaofang/Assets/Scenes/HylScene/Test.unity @@ -378,6 +378,11 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 373930957} m_CullTransparentMesh: 1 +--- !u!224 &396693239 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3077635299444999927, guid: 940be89243a038b4090a77556e45a06d, type: 3} + m_PrefabInstance: {fileID: 3077635299975306478} + m_PrefabAsset: {fileID: 0} --- !u!1 &571027939 GameObject: m_ObjectHideFlags: 0 @@ -1083,6 +1088,255 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1001 &1579681314 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 396693239} + m_Modifications: + - target: {fileID: 46083686991999376, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083687380014704, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.x + value: 101 + objectReference: {fileID: 0} + - target: {fileID: 46083687380014704, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.y + value: 226.40001 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.x + value: 344.1 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.y + value: 86.76 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.x + value: 203.05 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065382, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.y + value: -139.02 + objectReference: {fileID: 0} + - target: {fileID: 46083687645065385, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 46083688438047261, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.5000076 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597676, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Name + value: OpcOrder2 1 (1) + objectReference: {fileID: 0} + - target: {fileID: 46083688657597676, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_RootOrder + value: 12 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalScale.x + value: 0.9 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalScale.y + value: 0.8 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.x + value: 1828 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.y + value: 249 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 46083688657597677, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 823124465897836687, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_TargetGraphic + value: + objectReference: {fileID: 1916291583} + - target: {fileID: 823124465897836687, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Colors.m_PressedColor.b + value: 0.09718761 + objectReference: {fileID: 0} + - target: {fileID: 823124465897836687, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Colors.m_PressedColor.g + value: 0.09718761 + objectReference: {fileID: 0} + - target: {fileID: 823124465897836687, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Colors.m_PressedColor.r + value: 0.9811321 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.x + value: 344.1 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_SizeDelta.y + value: 86.76 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.x + value: 203.05 + objectReference: {fileID: 0} + - target: {fileID: 2109125590881905030, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_AnchoredPosition.y + value: -43.38 + objectReference: {fileID: 0} + - target: {fileID: 2166922752449803930, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Spacing.y + value: 8.88 + objectReference: {fileID: 0} + - target: {fileID: 2166922752449803930, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_CellSize.y + value: 86.76 + objectReference: {fileID: 0} + - target: {fileID: 2166922752449803930, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Padding.m_Bottom + value: 44 + objectReference: {fileID: 0} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: Tip + value: + objectReference: {fileID: 1723929262} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: itemPrefab + value: + objectReference: {fileID: 0} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: jsonReader + value: + objectReference: {fileID: 2009348684} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: ItemList.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2410299759049940670, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: ItemList.Array.data[0] + value: + objectReference: {fileID: 1811662063} + - target: {fileID: 6987064875164557437, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_FontData.m_MaxSize + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 6987064875164557437, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_FontData.m_MinSize + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6987064875164557437, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_FontData.m_FontSize + value: 65 + objectReference: {fileID: 0} + - target: {fileID: 6987064875164557437, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + propertyPath: m_FontData.m_Alignment + value: 6 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} --- !u!1 &1617184227 GameObject: m_ObjectHideFlags: 0 @@ -1163,6 +1417,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1617184227} m_CullTransparentMesh: 1 +--- !u!1 &1723929262 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 46083687380014707, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + m_PrefabInstance: {fileID: 1579681314} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1723929264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723929262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &1811662063 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 46083687645065385, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + m_PrefabInstance: {fileID: 1579681314} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1916291583 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 46083688439670448, guid: 09ab129ab15635d4482ae5617eb97556, type: 3} + m_PrefabInstance: {fileID: 1579681314} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1946593407 GameObject: m_ObjectHideFlags: 0 @@ -1242,6 +1534,17 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 +--- !u!114 &2009348684 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3077635298785468485, guid: 940be89243a038b4090a77556e45a06d, type: 3} + m_PrefabInstance: {fileID: 3077635299975306478} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 13fa0701c49727a4c84282a40243e52d, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &2059853627 GameObject: m_ObjectHideFlags: 0 @@ -1363,6 +1666,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 1834348371, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_Name + value: progress + objectReference: {fileID: 0} + - target: {fileID: 1834348371, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 750830055985094909, guid: 940be89243a038b4090a77556e45a06d, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -1387,6 +1698,42 @@ PrefabInstance: propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 848627416208138492, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: itemPrefab + value: + objectReference: {fileID: 1811662063} + - target: {fileID: 848627416208138492, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: ItemList.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721369072280, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1809610721856505750, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_Text + value: "\u5F15\u5BFC\u758F\u6563" + objectReference: {fileID: 0} - target: {fileID: 2439165017323073229, guid: 940be89243a038b4090a77556e45a06d, type: 3} propertyPath: m_Colors.m_PressedColor.b value: 0.09718761 @@ -1399,6 +1746,10 @@ PrefabInstance: propertyPath: m_Colors.m_PressedColor.r value: 0.9811321 objectReference: {fileID: 0} + - target: {fileID: 3032695104010050648, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_Text + value: "\u4E3B\u6301\u4EBA" + objectReference: {fileID: 0} - target: {fileID: 3032695104264456879, guid: 940be89243a038b4090a77556e45a06d, type: 3} propertyPath: m_SizeDelta.x value: 0 @@ -1427,6 +1778,10 @@ PrefabInstance: propertyPath: m_SizeDelta.y value: 226.40001 objectReference: {fileID: 0} + - target: {fileID: 3032695105541230308, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3032695105541230308, guid: 940be89243a038b4090a77556e45a06d, type: 3} propertyPath: m_AnchorMax.y value: 1 @@ -1451,6 +1806,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: -139.02 objectReference: {fileID: 0} + - target: {fileID: 3032695105541230315, guid: 940be89243a038b4090a77556e45a06d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 3077635299444999927, guid: 940be89243a038b4090a77556e45a06d, type: 3} propertyPath: m_Pivot.x value: 0 diff --git a/xiaofang/Assets/Script/UI/ZZZZZZ/Chooselitem8.cs b/xiaofang/Assets/Script/UI/ZZZZZZ/Chooselitem8.cs index 53c95b2f..033dae46 100644 --- a/xiaofang/Assets/Script/UI/ZZZZZZ/Chooselitem8.cs +++ b/xiaofang/Assets/Script/UI/ZZZZZZ/Chooselitem8.cs @@ -10,6 +10,10 @@ public class Chooselitem8 : MonoBehaviour public Text text; public static Chooselitem8 Instance; public JSONReader JSONReader; + public void Start() + { + Instance = this; + } public void CreateItem(int ID) { GameObject newitem=Instantiate(prefab,PrefabTransform); diff --git a/xiaofang/Assets/Script/UI/ZZZZZZ/OpcOrder2.cs b/xiaofang/Assets/Script/UI/ZZZZZZ/OpcOrder2.cs index edac5220..1ea0788c 100644 --- a/xiaofang/Assets/Script/UI/ZZZZZZ/OpcOrder2.cs +++ b/xiaofang/Assets/Script/UI/ZZZZZZ/OpcOrder2.cs @@ -136,7 +136,7 @@ public class OpcOrder2 : MonoBehaviour public GameObject itemPrefab; // 用于生成的Item预制体 public Transform contentTransform; // Content的Transform public JSONReader jsonReader; - List> groupedData; + public List> groupedData; public List ItemList; public string name; @@ -150,10 +150,10 @@ public class OpcOrder2 : MonoBehaviour { bool isActive = Tip.activeSelf; Tip.SetActive(!isActive); - if (ItemList.Count == 1) + if (ItemList.Count == 0) { Debug.Log("进来了"); - CreateItem(2001, 1); + CreateItem(2001, 0); } }); } @@ -168,7 +168,7 @@ public class OpcOrder2 : MonoBehaviour } public void CreateItem(int ID, int k) { - if (k >= 3) + if (k > 3) { if (k == 4) k = 1; if (k == 5) k = 2; @@ -185,6 +185,20 @@ public class OpcOrder2 : MonoBehaviour groupedData = ParseData(select.Role); } } + print(groupedData.Count); + // 检查 k 是否有效 + if (k < 0 || k >= groupedData.Count) + { + Debug.LogError($"索引 k 超出范围!k = {k}, groupedData.Count = {groupedData.Count}"); + return; + } + + // 检查 groupedData[k] 是否为空或无数据 + if (groupedData[k] == null || groupedData[k].Count == 0) + { + Debug.LogError($"groupedData[{k}] 是空或没有数据!"); + return; + } // 动态生成Item并添加到Content for (int i = 0; i < groupedData[k].Count; i++) @@ -217,6 +231,7 @@ public class OpcOrder2 : MonoBehaviour // 点击事件处理函数,支持单独管理 private void OnItemClick(GameObject item, int index) { + Debug.Log("被点击了" + index); if ( item.GetComponentInChildren().text==name) { @@ -240,8 +255,23 @@ public class OpcOrder2 : MonoBehaviour //设置文本 public void SetItemText(int k) { - for (int i = 1; i < ItemList.Count; i++) + // 检查 k 是否有效 + if (k < 0 || k >= groupedData.Count) { + Debug.LogError($"索引 k 超出范围!k = {k}, groupedData.Count = {groupedData.Count}"); + return; + } + + for (int i = 1; i < ItemList.Count+1; i++) + { + // 检查 i 是否超出 groupedData[k] 的范围 + if (i >= groupedData[k].Count) + { + Debug.LogWarning($"索引 i 超出范围!i = {i}, groupedData[{k}].Count = {groupedData[k].Count}"); + break; + } + + Text itemText = ItemList[i].GetComponentInChildren(); if (itemText != null) {