From d968502e3ad816a817ef1578d885c4443b25a841 Mon Sep 17 00:00:00 2001 From: "PC-202302260912\\Administrator" <419983115@qq.com> Date: Thu, 5 Dec 2024 20:08:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Shop/ShopBuyPopup.prefab | 4 +- .../Prefabs/UI/ShopView/ShopView.prefab | 110 ++++++++++++++++-- .../ManagedResources/~Lua/View/ShopView.lua | 12 +- 3 files changed, 112 insertions(+), 14 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Shop/ShopBuyPopup.prefab b/Assets/ManagedResources/Prefabs/UI/Shop/ShopBuyPopup.prefab index fbb705c3b7..b2136169ee 100644 --- a/Assets/ManagedResources/Prefabs/UI/Shop/ShopBuyPopup.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Shop/ShopBuyPopup.prefab @@ -442,7 +442,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 474.8, y: -37} - m_SizeDelta: {x: 260, y: 74} + m_SizeDelta: {x: 260, y: 85} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &222592833259871116 CanvasRenderer: @@ -472,7 +472,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 6ff20609e8c68014394e6b730e1c7948, type: 3} + m_Sprite: {fileID: 21300000, guid: e0d70e0322fd03b4bbf550d673a7cc5d, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 diff --git a/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab b/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab index bdfb2dd486..ed9674163a 100644 --- a/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab +++ b/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab @@ -582,15 +582,16 @@ RectTransform: m_GameObject: {fileID: 1157730044481472} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.7, y: 0.7, z: 1} - m_Children: [] + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7762063819831567671} m_Father: {fileID: 3094864558833778807} m_RootOrder: 6 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: -231, y: 111.4} - m_SizeDelta: {x: 184, y: 74} + m_AnchoredPosition: {x: -204.7, y: 101} + m_SizeDelta: {x: 83, y: 86} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &222326265939223336 CanvasRenderer: @@ -620,7 +621,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 053953f2b467d9a4dbee3e3bc211a001, type: 3} + m_Sprite: {fileID: 21300000, guid: c4ff311767f71824e96d037b7000f7b0, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -3141,7 +3142,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -144.9, y: 4.5999513} - m_SizeDelta: {x: 137, y: 127} + m_SizeDelta: {x: 150, y: 122} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &180724177236460629 CanvasRenderer: @@ -3171,7 +3172,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: d2eff9e1ef9c15745986a5aa489eb10c, type: 3} + m_Sprite: {fileID: 21300000, guid: 1ed5318bb89065649bcd7268a24a4c1a, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -7226,6 +7227,101 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &9181231903437762513 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7762063819831567671} + - component: {fileID: 7922298542274025540} + - component: {fileID: 3730143632149261839} + - component: {fileID: 3790747074884602877} + m_Layer: 5 + m_Name: zekouImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7762063819831567671 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9181231903437762513} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.7, y: 0.7, z: 1} + m_Children: [] + m_Father: {fileID: 224180545808046118} + m_RootOrder: 0 + 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: -36.3, y: 22.6} + m_SizeDelta: {x: 75.17, y: 86.23} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7922298542274025540 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9181231903437762513} + m_CullTransparentMesh: 0 +--- !u!114 &3730143632149261839 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9181231903437762513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: be22547d075a3fa439f78ce38cdb4beb, type: 3} + m_FontSize: 70 + m_FontStyle: 2 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 80 + m_Alignment: 5 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 9 +--- !u!114 &3790747074884602877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9181231903437762513} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -900027084, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 3, y: -3} + m_UseGraphicAlpha: 1 --- !u!1 &9188977090771340237 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index 508527973f..f4b5b7e076 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -488,7 +488,8 @@ function this:ShopItemAdapter(shopItem, itemData) local priceBg = Util.GetGameObject(bg, "pricebg") local itemPrice = Util.GetGameObject(bg, "pricebg/price"):GetComponent("Text") local costIcon = Util.GetGameObject(bg, "pricebg/costIcon"):GetComponent("Image") - local discountbg = Util.GetGameObject(bg, "discountbg") + local discountbg = Util.GetGameObject(bg, "discountbg/zekouImage") + local discountbg1 = Util.GetGameObject(bg, "discountbg") local empty = Util.GetGameObject(shopItem, "empty") local yihuode = Util.GetGameObject(shopItem, "yihuode") local lock = Util.GetGameObject(shopItem, "lock") @@ -527,14 +528,15 @@ function this:ShopItemAdapter(shopItem, itemData) --itemInfo.GoodsName -- 折扣 if price == 0 then - discountbg:SetActive(true) - discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_00_zh") + discountbg1:SetActive(true) + discountbg1:GetComponent("Image").sprite = self.spLoader:LoadSprite("X1_jingjichang_mianfei_zh") + discountbg:SetActive(false) else local isDiscount = itemInfo.IsDiscount == 1 + discountbg1:SetActive(isDiscount) discountbg:SetActive(isDiscount) if isDiscount then - discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" .. - itemInfo.DiscountDegree .. "_zh") + discountbg:GetComponent("Text").text = itemInfo.DiscountDegree end end -- 消耗物品的信息