Commit 266ee383 authored by Tt's avatar Tt

细节修改

parent ca00bc71
......@@ -1321,8 +1321,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1320,
"height": 960
"width": 1342,
"height": 919
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1377,7 +1377,7 @@
"__uuid__": "c9f7d5ba-b915-4205-b652-ff3a0db89faa"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1397,7 +1397,7 @@
"node": {
"__id__": 29
},
"_enabled": true,
"_enabled": false,
"r_width": 1,
"r_height": 1,
"r_top": 0,
......@@ -1405,7 +1405,7 @@
"p_left": 0,
"p_right": 0,
"p_top": 0,
"p_bottom": 0,
"p_bottom": 1,
"black": 0,
"noHead": 0,
"debug": 0,
......@@ -1418,7 +1418,7 @@
"node": {
"__id__": 29
},
"_enabled": true,
"_enabled": false,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
......@@ -1637,8 +1637,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 327,
"height": 266
"width": 325,
"height": 264
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......
......@@ -218,34 +218,42 @@ cc.Class({
onTouchAudio(touch) {
if (this._gameCode != 0) return resolve('');
if (!this._cantouch) return;
this._cantouch = false;
// this._cantouch = false;
let item = touch.target.parent;
this.playAudioAni(item).then(() => {
this._cantouch = true;
// this._cantouch = true;
});
},
onTouchItem(touch, info) {
return new Promise((resolve, reject) => {
if (this._gameCode != 0) return resolve('');
if (!this._cantouch) return resolve('');
if (this._runId) {
//执行中断并直接完成
}
if (!this._runId) {
this._runId = Math.random() * 1000000000;
} else {
this._runId++;
}
let runId = this._runId;
let item = touch.target;
if (this._successItems.indexOf(item) > -1) return resolve('');
let data = item.data;
this._cantouch = false;
// this._cantouch = false;
if (data.right) {
this.catRight();
pg.view.visible(pg.view.find(item, 'box'), true);
this.playSFX("audio_right").then(() => {
//audio 播放的时候动画播放, audio停的时候 动画正好能停下
//如果动画停的位置不对,直接强制设置对应的效果
//下一次播放没有问题即可
if (runId != this._runId) {
this.touchStep5();
resolve('');
} else {
this.playAudioAni(item).then(() => {
this._cantouch = true;
this._successItems.push(item);
this.catNormal();
this.groupEnd();
this.touchStep5();
resolve('');
})
}
});
} else {
this.catError();
......@@ -262,18 +270,31 @@ cc.Class({
});
},
touchStep5(item) {
this.catNormal();
if (this._successItems.every(it => it.id != item.id)) {
this._successItems.push(item);
}
this.groupEnd();
},
playAudioAni(item) {
return new Promise((resolve, reject) => {
// var anim = pg.view.find(item, `audio`).getComponent(cc.Animation);
// anim.play();
let items = this._cardLayout.children;
items.forEach(it => {
let audio = pg.view.find(it, `audio`);
let icon_1 = pg.view.find(audio, "icon_1");
icon_1.active = false;
})
let audio = pg.view.find(item, `audio`);
let icon_1 = pg.view.find(audio, "icon_1");
let icon_2 = pg.view.find(audio, "icon_2");
let icon_3 = pg.view.find(audio, "icon_3");
icon_1.active = true;
//如果没有audio也要能正常走
pg.audio.playAudioByUrl(item.data.audio).then(() => {
// anim.stop();
cc.audioEngine.stopAll();
// this.playUrlId && cc.audioEngine.stop(this.playUrlId);
pg.audio.playAudioByUrl(item.data.audio).then((audioId) => {
this.playUrlId = audioId;
icon_1.active = false;
resolve('');
});
......
......@@ -810,7 +810,7 @@ class AudioUtil {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(audioId, () => {
resolve(audioClip);
resolve(audioId);
});
});
});
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1332,
"height": 960,
"width": 1342,
"height": 919,
"platformSettings": {},
"subMetas": {
"bg_1": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1332,
"height": 960,
"rawWidth": 1332,
"rawHeight": 960,
"width": 1342,
"height": 919,
"rawWidth": 1342,
"rawHeight": 919,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 327,
"height": 266,
"width": 325,
"height": 264,
"platformSettings": {},
"subMetas": {
"bg_pic-bg": {
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 327,
"height": 266,
"rawWidth": 327,
"rawHeight": 266,
"width": 325,
"height": 264,
"rawWidth": 325,
"rawHeight": 264,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
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