Commit a621fdcd authored by Li MingZhe's avatar Li MingZhe

fix: pos

parent 31c655ad
......@@ -58,7 +58,7 @@
<button nz-button nzType="dashed" (click)="addGroupBtnClick()" style="width: 150px; height: 55px; margin: 50px;">
<button *ngIf="item.groupArr?.length <= 4" nz-button nzType="dashed" (click)="addGroupBtnClick()" style="width: 150px; height: 55px; margin: 50px;">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加题
</button>
......
......@@ -94,7 +94,7 @@ cc.Class({
_animaResList: null,
preloadItem() {
this.addPreloadImage();
// this.addPreloadAudio();
this.addPreloadAudio();
// this.addPreloadAnima();
this.preload();
},
......@@ -130,26 +130,13 @@ cc.Class({
for (let i=0; i<groupArr.length; i++) {
this._imageResList.push({ url: groupArr[i].pic_url || ''});
}
}
},
addPreloadAudio() {
const groupArr = this.data.groupArr;
if (groupArr) {
for (let i=0; i<groupArr.length; i++) {
const optionArr = groupArr[i].optionArr;
for (let j=0; j<optionArr.length; j++) {
this._audioResList.push({ url: optionArr[j].audio_url || ''});
}
this._audioResList.push({ url: groupArr[i].audio_url || ''});
}
}
this._audioResList.push({ url: this.data.title_audio_url || ''});
},
addPreloadAnima() {
......@@ -269,11 +256,11 @@ cc.Class({
initPosArr() {
this.posData = {
'1': [[0, 0]],
'2': [[-50, 150], [50, -150]],
'1': [[100, 0]],
'2': [[-50, 150], [200, -150]],
'3': [[-50, 150], [50, -150], [350, 0]],
'4': [[-250, 130], [-100, -150], [125, 150], [300, -130]],
'5': [[-250, 130], [-200, -180], [25, 150], [130, -130], [350, 50]],
'4': [[-150, 130], [0, -150], [225, 150], [400, -130]],
'5': [[-200, 170], [-100, -180], [125, 150], [230, -150], [470, 20]],
'6': [[], [], [], [], [], []],
'7': [[], [], [], [], [], [], []],
}
......@@ -502,7 +489,7 @@ cc.Class({
console.log('this.posData: ', this.posData);
const key = arr.length
const key = 5//arr.length
const posArr = this.posData[key.toString()];
for (let i=0; i<key; i++) {
const bottle = this.getBottle(arr[i]);
......@@ -529,7 +516,7 @@ cc.Class({
}
this.role = role;
role.x = -500 * this._mapScaleMin;
role.x = -470 * this._mapScaleMin;
role.y = -40 * this._mapScaleMin;
role.baseX = role.x;
......@@ -663,7 +650,7 @@ cc.Class({
},
delayCall(time, cb) {
cc.tween(this)
return cc.tween(this)
.delay(time)
.call(() => {
if (cb) {
......@@ -734,8 +721,6 @@ cc.Class({
this.roleBack();
this.setLayer2ByData();
this.hideSpeakIcon();
this.layer1.active = false;
this.layer2.active = true;
......@@ -756,6 +741,8 @@ cc.Class({
this.setLayer2Pic(data);
this.setLayer2TeacherPanel(data);
this.setLayer2StudentPanel(data);
this.hideSpeakIcon();
},
......@@ -875,6 +862,7 @@ cc.Class({
},
speakTween: null,
showSpeakIcon() {
if (this.isTeacher) {
......@@ -885,11 +873,13 @@ cc.Class({
this.appear(this.speakIcon, 0.5)
playAudio(this.speakClip);
const tmpBottle = this.curBottle;
this.delayCall(3, () => {
if (tmpBottle == this.curBottle) {
this.hideSpeakIcon();
}
if (this.speakTween) {
this.speakTween.stop();
}
this.speakTween = this.delayCall(3, () => {
this.hideSpeakIcon();
this.speakTween = null;
})
},
......
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