From 173221dd1aa9720d7be7bbdd9514a685d535bd82 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Mon, 8 Nov 2021 17:22:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ID1010656=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E5=95=86=E5=BA=97=E4=BC=98=E5=8C=96=E3=80=91=E9=AD=82=E5=8D=B0?= =?UTF-8?q?=E5=95=86=E5=BA=97=E4=B8=AD=EF=BC=8C=E7=8E=A9=E5=AE=B6=E5=B0=9A?= =?UTF-8?q?=E6=9C=AA=E8=8E=B7=E5=BE=97=E8=BF=87=E7=9A=84=E9=AD=82=E5=8D=B0?= =?UTF-8?q?=E4=B8=8A=E6=B7=BB=E5=8A=A0=E2=80=9C=E6=96=B0=E2=80=9D=E6=A0=87?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/ShopView/ShopView.prefab | 79 ++++++++++++++++++- .../Modules/SoulPrint/SoulPrintManager.lua | 6 ++ .../ManagedResources/~Lua/View/ShopView.lua | 12 ++- 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab b/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab index c12131e5f2..6a6b3d906e 100644 --- a/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab +++ b/Assets/ManagedResources/Prefabs/UI/ShopView/ShopView.prefab @@ -838,7 +838,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &224172487803996794 RectTransform: m_ObjectHideFlags: 0 @@ -1706,7 +1706,7 @@ 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: -2133, y: 232} + m_AnchoredPosition: {x: -2133, y: 674} m_SizeDelta: {x: 216, y: 434} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &222189988231697376 @@ -2752,6 +2752,7 @@ RectTransform: - {fileID: 3094864558833778807} - {fileID: 7868471710346716691} - {fileID: 224758322593848220} + - {fileID: 7988514468786704464} m_Father: {fileID: 224172487803996794} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -4511,6 +4512,80 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 160, y: 40} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &3219191283840862740 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7988514468786704464} + - component: {fileID: 5878404588687697688} + - component: {fileID: 263471138794148527} + m_Layer: 5 + m_Name: new + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7988514468786704464 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3219191283840862740} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4300363014719737227} + m_RootOrder: 3 + 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: -52.1, y: 91.7} + m_SizeDelta: {x: 58, y: 58} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5878404588687697688 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3219191283840862740} + m_CullTransparentMesh: 0 +--- !u!114 &263471138794148527 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3219191283840862740} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 1412f0395d549ba4384894d8e8b33dee, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 --- !u!1 &3815434678658175326 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintManager.lua b/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintManager.lua index 7c1aa6963f..1fb32a5fc2 100644 --- a/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintManager.lua @@ -49,6 +49,12 @@ function this.GetAllHavedSoulPrint() return this.allHavedSoulPrint end +function this.CheckSoulExist(soulId) + if this.allHavedSoulPrint[soulId] and this.allHavedSoulPrint[soulId] > 0 then + return true + end + return false +end function this.CreateSoulPrintData() return { diff --git a/Assets/ManagedResources/~Lua/View/ShopView.lua b/Assets/ManagedResources/~Lua/View/ShopView.lua index f976726ab8..3547282fed 100644 --- a/Assets/ManagedResources/~Lua/View/ShopView.lua +++ b/Assets/ManagedResources/~Lua/View/ShopView.lua @@ -487,7 +487,7 @@ function this:ShopItemAdapter(shopItem, itemData) local empty = Util.GetGameObject(shopItem, "empty") local lock = Util.GetGameObject(shopItem, "lock") local lockTip = Util.GetGameObject(shopItem, "lock/tip"):GetComponent("Text") - + local new = Util.GetGameObject(shopItem, "GameObject/new") -- 计算数据 local itemInfo = ShopManager.GetShopItemInfo(itemData.id) local curBuyCount = itemData.buyNum @@ -577,6 +577,16 @@ function this:ShopItemAdapter(shopItem, itemData) effect.gameObject:SetActive(true) end + if self.ShopType == SHOP_TYPE.SOUL_PRINT_SHOP then + if SoulPrintManager.CheckSoulExist(con.Id) then + new.gameObject:SetActive(false) + else + new.gameObject:SetActive(true) + end + else + new.gameObject:SetActive(false) + end + -- 购买事件 Util.AddOnceClick(lock, function() PopupTipPanel.ShowTip(Language[12038])