From 672fcaf97490705ecd924abba08f7da073aa20cd Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 2 Nov 2021 15:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E9=AD=82=E5=8D=B0=E5=9B=BE=E9=89=B4=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/SoulPrint/SoulPrintHandBook.prefab | 47 ++++++++++++++++++- .../Modules/SoulPrint/SoulPrintHandBook.lua | 12 ++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/SoulPrint/SoulPrintHandBook.prefab b/Assets/ManagedResources/Prefabs/UI/SoulPrint/SoulPrintHandBook.prefab index 5b16d586af..2ca7aa85ab 100644 --- a/Assets/ManagedResources/Prefabs/UI/SoulPrint/SoulPrintHandBook.prefab +++ b/Assets/ManagedResources/Prefabs/UI/SoulPrint/SoulPrintHandBook.prefab @@ -5086,7 +5086,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 + m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -26185,6 +26185,7 @@ GameObject: - component: {fileID: 453287596651342905} - component: {fileID: 445543143482258547} - component: {fileID: 6582376449090890826} + - component: {fileID: 2631583222854372660} m_Layer: 5 m_Name: mask m_TagString: Untagged @@ -26232,7 +26233,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.5882353} + m_Color: {r: 0, g: 0, b: 0, a: 0.78431374} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -26248,6 +26249,48 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!114 &2631583222854372660 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7605357405375979348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6582376449090890826} + m_OnClick: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &7751242624397159161 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintHandBook.lua b/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintHandBook.lua index f899e8fdde..79346535c3 100644 --- a/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintHandBook.lua +++ b/Assets/ManagedResources/~Lua/Modules/SoulPrint/SoulPrintHandBook.lua @@ -19,6 +19,7 @@ local list={} function SoulPrintHandBook:InitComponent() this.spLoader = SpriteLoader.New() this.backBtn = Util.GetGameObject(this.gameObject, "BackBtn") + this.mask = Util.GetGameObject(this.gameObject, "mask") for i = 1, 4 do tabs[i] = Util.GetGameObject(this.gameObject, "Tabs/Btn" .. i) end @@ -61,6 +62,11 @@ function SoulPrintHandBook:BindEvent() PlaySoundWithoutClick(SoundConfig.Sound_UICancel) self:ClosePanel() end) + --关闭页面 + Util.AddClick(this.mask, function() + PlaySoundWithoutClick(SoundConfig.Sound_UICancel) + self:ClosePanel() + end) end function SoulPrintHandBook:AddListener() @@ -176,7 +182,11 @@ function this.SetScrollPre(root,data) icon.sprite=this.spLoader:LoadSprite(GetResourcePath(itemConfig[data.Id].ResourceID)) Util.GetGameObject(root,"circleFrameBg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[data.Id].Quantity].circleBg2) Util.GetGameObject(root,"circleFrameBg/circleFrame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[data.Id].Quantity].circle) - name.text=SubString2(GetLanguageStrById(data.Name),10) + local str = data.Name + if GetCurLanguage() == 0 and LengthString(data.Name)>=5 then + str = SubString(data.Name,4).."..." + end + name.text = str--SubString2(GetLanguageStrById(data.Name),10) end return SoulPrintHandBook \ No newline at end of file