Commit 44ffcbd9 authored by limingzhe's avatar limingzhe

fix: debug 名字异常

parent a66129e0
...@@ -198,7 +198,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -198,7 +198,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
const lessonsBtn = this.rootAttrTree.querySelectorAll('.lesson-button'); const lessonsBtn = this.rootAttrTree.querySelectorAll('.lesson-button');
lessonsBtn.forEach(b => { lessonsBtn.forEach((b, idx) => {
const attr: Attributes = b.getComponent('Attributes'); const attr: Attributes = b.getComponent('Attributes');
const lock = cc.find('icon_key', b); const lock = cc.find('icon_key', b);
lock.active = true; lock.active = true;
...@@ -218,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -218,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline} titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>` width=4>${name}</outline>`
}); });
...@@ -238,7 +239,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -238,7 +239,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// rows = rows.filter(r => !r.has_courseware) // rows = rows.filter(r => !r.has_courseware)
console.log('UnitView', list); console.log('UnitView', list);
lessonsBtn.forEach(b => { lessonsBtn.forEach((b, idx) => {
const attr: Attributes = b.getComponent('Attributes'); const attr: Attributes = b.getComponent('Attributes');
const index = attr.attrMap['index']; const index = attr.attrMap['index'];
const lesson = list[index]; const lesson = list[index];
...@@ -275,12 +276,23 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -275,12 +276,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
richText.font = cc.find("Canvas/res/font/BRLNSDB").getComponent(cc.Label).font; 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} titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</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} titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`; width=4>${name}</outline>`;
console.log("显示按钮名2:", titleNode.getComponent(cc.RichText).string);
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment