Commit 31c655ad authored by Li MingZhe's avatar Li MingZhe

fix: online bug

parent 97b53cba
No preview for this file type
......@@ -184,14 +184,20 @@ cc.Class({
addServerListener() {
console.log(' in addServerListener');
const c = window.courseware;
if (!c) {
return;
}
console.log(' in addServerListener 2 : ', this.isTeacher);
if (this.isTeacher) {
c.onEvent('show_cap', (data, next) => {
console.log('in show_cap event', data);
this.showCapAnima(data.index);
next();
});
......@@ -204,6 +210,7 @@ cc.Class({
});
c.onEvent('show_answer', (data, next) => {
console.log('in show_answer event', data);
this.showStudentPanelLabel(data.isRight);
next();
});
......@@ -516,7 +523,10 @@ cc.Class({
const resDragonBone = cc.find("Canvas/res/anima/role")
const role = cc.instantiate(resDragonBone)
role.scale = this._mapScaleMin;
this.layer1.addChild(role, 5);
if (!this.isTeacher) {
this.layer1.addChild(role, 5);
}
this.role = role;
role.x = -500 * this._mapScaleMin;
......@@ -724,6 +734,7 @@ cc.Class({
this.roleBack();
this.setLayer2ByData();
this.hideSpeakIcon();
this.layer1.active = false;
......@@ -866,9 +877,20 @@ cc.Class({
showSpeakIcon() {
if (this.isTeacher) {
return;
}
this.speakIcon.active = true;
this.appear(this.speakIcon, 0.5)
playAudio(this.speakClip);
const tmpBottle = this.curBottle;
this.delayCall(3, () => {
if (tmpBottle == this.curBottle) {
this.hideSpeakIcon();
}
})
},
hideSpeakIcon() {
......@@ -907,9 +929,9 @@ cc.Class({
this.initPic();
this.initTeacherPanel();
this.initStudentPanel();
// if (this.isTeacher) {
if (this.isTeacher) {
this.initTeacherBtn();
// }
}
this.initSpeakIcon();
this.initWrongAndRightAnima();
},
......
No preview for this file type
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