From 44ffcbd994e4efa77db87721eba0ac9a66192f80 Mon Sep 17 00:00:00 2001 From: limingzhe <limingzhe@iplayabc.com> Date: Thu, 15 Sep 2022 16:13:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20debug=20=E5=90=8D=E5=AD=97=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/NJ_MonkyTree/scene/NJ_MonkyTree.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/NJ_MonkyTree/scene/NJ_MonkyTree.ts b/assets/NJ_MonkyTree/scene/NJ_MonkyTree.ts index d6655b6..7ea41fb 100644 --- a/assets/NJ_MonkyTree/scene/NJ_MonkyTree.ts +++ b/assets/NJ_MonkyTree/scene/NJ_MonkyTree.ts @@ -198,7 +198,7 @@ export default class SceneComponent extends MyCocosSceneComponent { const lessonsBtn = this.rootAttrTree.querySelectorAll('.lesson-button'); - lessonsBtn.forEach(b => { + lessonsBtn.forEach((b, idx) => { const attr: Attributes = b.getComponent('Attributes'); const lock = cc.find('icon_key', b); lock.active = true; @@ -218,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent { titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline} width=4>${name}</outline>` + }); @@ -238,7 +239,7 @@ export default class SceneComponent extends MyCocosSceneComponent { // rows = rows.filter(r => !r.has_courseware) console.log('UnitView', list); - lessonsBtn.forEach(b => { + lessonsBtn.forEach((b, idx) => { const attr: Attributes = b.getComponent('Attributes'); const index = attr.attrMap['index']; const lesson = list[index]; @@ -275,12 +276,23 @@ export default class SceneComponent extends MyCocosSceneComponent { } richText.font = cc.find("Canvas/res/font/BRLNSDB").getComponent(cc.Label).font; + console.log('idx: ', idx); + console.log("ä¼ å…¥æŒ‰é’®å1:", name); titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline} width=4>${name}</outline>`; - delayCall(0.2, () => { + console.log("显示按钮å1:", titleNode.getComponent(cc.RichText).string); + + + delayCall(1, () => { + + console.log('idx: ', idx); + console.log("ä¼ å…¥æŒ‰é’®å2:", name); + titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline} width=4>${name}</outline>`; + console.log("显示按钮å2:", titleNode.getComponent(cc.RichText).string); + }) } -- 2.21.0