From c3ca663b218544b363655c7ebf237956ec87554b Mon Sep 17 00:00:00 2001 From: Lihao7788 <2470304407@qq.com> Date: Tue, 3 Jun 2025 13:45:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9KnowIedgeBug,=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=B7=E6=96=B0=E7=BB=84=E4=BB=B6=E5=89=8D=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E6=AC=A1=E5=AD=90=E9=A1=B9=EF=BC=8C=E9=9F=B3?= =?UTF-8?q?=E9=A2=91=E5=B7=A5=E5=85=B7=E6=B7=BB=E5=8A=A0=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E9=9F=B3=E9=A2=91=E5=90=8E=E8=BD=AC=E5=88=B0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E3=80=82=E6=B7=BB=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=92=AD=E6=94=BE=EF=BC=8C=E5=86=8D=E6=AC=A1=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/AudioAction.cs | 2 ++ Assets/Scripts/UILongPicture/UIKnowledge.cs | 13 +++++++- Data/Xml/01_ShiYanLiLunRenZhi.xml | 37 ++++++++++++++++++--- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Actions/AudioAction.cs b/Assets/Scripts/Actions/AudioAction.cs index 058b067b..fa30700d 100644 --- a/Assets/Scripts/Actions/AudioAction.cs +++ b/Assets/Scripts/Actions/AudioAction.cs @@ -119,6 +119,8 @@ namespace QFramework AudioKit.StopAllSound(); break; } + this.Finish(); + } } diff --git a/Assets/Scripts/UILongPicture/UIKnowledge.cs b/Assets/Scripts/UILongPicture/UIKnowledge.cs index cda7d498..26ec4b96 100644 --- a/Assets/Scripts/UILongPicture/UIKnowledge.cs +++ b/Assets/Scripts/UILongPicture/UIKnowledge.cs @@ -14,7 +14,8 @@ namespace QFramework.Example public partial class UIKnowledge : UIPanel { ResLoader loader; - + Transform content; + Transform subContent; Dictionary sprites = new Dictionary(); IAction curAction; @@ -32,6 +33,8 @@ namespace QFramework.Example UIKit.OpenPanelAsync().ToAction().StartGlobal(); }); + + } protected override void OnOpen(IUIData uiData = null) @@ -39,6 +42,7 @@ namespace QFramework.Example if (Global.Instance.curModule.knowledge != null && Global.Instance.curModule.knowledge.items != null) { LeftContent.RemoveAllChildren(); + GlobalComs.RemoveAllChildren(); string bg = Global.Instance.curModule.knowledge.bgImage; LoadBgImage(bg, () => { @@ -55,8 +59,10 @@ namespace QFramework.Example public void ItemFactory(XMLTool.Knowledge.Item itemData, Transform parent = null) { Transform content = parent == null ? LeftContent : parent; + GameObject leftObj = GameObject.Instantiate(LeftItem.gameObject, content); Transform subContent = leftObj.transform.Find("SubContent"); + Toggle toggle = leftObj.transform.Find("Toggle").GetComponent(); TextMeshProUGUI label = toggle.transform.Find("Name").GetComponent(); label.text = itemData.title; @@ -103,6 +109,7 @@ namespace QFramework.Example /// public void RefreshComponents(List coms, Transform content) { + int numIndex = 0; if (coms != null && coms.Count > 0) { foreach (var ComData in coms) @@ -111,6 +118,7 @@ namespace QFramework.Example { case "Button": GameObject btn = GameObject.Instantiate(BtnPrefab.gameObject, content); + btn.name ="Btn" +numIndex; btn.GetComponent().sizeDelta = Utility.GetVector2FromStrArray(ComData.size); btn.transform.localPosition = Utility.GetVector2FromStrArray(ComData.pos); btn.GetComponent