Commit 00f1008c authored by Tt's avatar Tt

修改公共问题

parent 2d3ac2b9
...@@ -60,8 +60,12 @@ export default class LayerBack extends cc.Component { ...@@ -60,8 +60,12 @@ export default class LayerBack extends cc.Component {
this.audioId = audioId; this.audioId = audioId;
}); });
} }
protected onDestroy(): void {
this.unscheduleAllCallbacks();
}
playVoiceRunning() { playVoiceRunning() {
this.playVoiceCount++; this.playVoiceCount++;
if (!this.img_npc_voice) return;
let p1 = this.img_npc_voice.getChildByName('p1') let p1 = this.img_npc_voice.getChildByName('p1')
let p2 = this.img_npc_voice.getChildByName('p2') let p2 = this.img_npc_voice.getChildByName('p2')
let p3 = this.img_npc_voice.getChildByName('p3') let p3 = this.img_npc_voice.getChildByName('p3')
......
...@@ -30,8 +30,12 @@ export default class ImgVoice extends cc.Component { ...@@ -30,8 +30,12 @@ export default class ImgVoice extends cc.Component {
this.playVoiceCount = 0; this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3) this.schedule(this.playVoiceRunning, 0.3)
} }
protected onDestroy(): void {
this.unscheduleAllCallbacks();
}
playVoiceRunning() { playVoiceRunning() {
this.playVoiceCount++; this.playVoiceCount++;
if (!this.img_npc_voice) return;
let p1 = this.img_npc_voice.getChildByName('p1') let p1 = this.img_npc_voice.getChildByName('p1')
let p2 = this.img_npc_voice.getChildByName('p2') let p2 = this.img_npc_voice.getChildByName('p2')
let p3 = this.img_npc_voice.getChildByName('p3') let p3 = this.img_npc_voice.getChildByName('p3')
......
...@@ -115,6 +115,7 @@ export default class LayerRecord extends cc.Component { ...@@ -115,6 +115,7 @@ export default class LayerRecord extends cc.Component {
playVoiceRunning() { playVoiceRunning() {
this.playVoiceCount++; this.playVoiceCount++;
let btn_play = pg.view.find(this.layout_record, 'btn_play'); let btn_play = pg.view.find(this.layout_record, 'btn_play');
if (!btn_play) return;
let p0 = btn_play.getChildByName('p0') let p0 = btn_play.getChildByName('p0')
let p1 = btn_play.getChildByName('p1') let p1 = btn_play.getChildByName('p1')
let p2 = btn_play.getChildByName('p2') let p2 = btn_play.getChildByName('p2')
......
This diff is collapsed.
...@@ -364,6 +364,7 @@ let pg = { ...@@ -364,6 +364,7 @@ let pg = {
if (!node) return; if (!node) return;
let component = node.getComponent(cc.Label);//组件功能 非node的功能 let component = node.getComponent(cc.Label);//组件功能 非node的功能
component.string = text; component.string = text;
component.cacheMode = cc.Label.CacheMode.CHAR;
return true; return true;
}, },
//更变颜色 //更变颜色
......
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