Commit 1e36a153 authored by Tt's avatar Tt

调整卡死部分

parent 5b7a1bd5
......@@ -22,6 +22,7 @@ export default class LayerBack extends cc.Component {
this.unscheduleAllCallbacks();
}
initView() {
this.canTouch = true;
this.bg_forbid = pg.view.find(this, 'bg_forbid')
this.btn_back = pg.view.find(this, 'btn_back')
this.label_title = pg.view.find(this, 'label_title')
......@@ -51,19 +52,22 @@ export default class LayerBack extends cc.Component {
}
private playVoiceCount: number;
private audioId: number;
private canTouch: boolean;
playVoiceStart() {
if (this.playVoiceCount > 0) {
if (!this.canTouch) return;
this.canTouch = false;
if (this.audioId) cc.audioEngine.stopEffect(this.audioId);
this.playVoiceEnd();
}
this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.audioId = null;
this.playVoiceEnd();
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
this.canTouch = true;
});
}
playVoiceRunning() {
......
......@@ -443,7 +443,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150.74,
"width": 148.45,
"height": 63
},
"_anchorPoint": {
......@@ -529,7 +529,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
208.95399999999995,
206.664,
0,
0,
0,
......
......@@ -21,17 +21,17 @@
"__id__": 2
},
{
"__id__": 16
"__id__": 17
}
],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 22
}
],
"_prefab": {
"__id__": 22
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -92,19 +92,19 @@
"__id__": 3
},
{
"__id__": 6
"__id__": 7
},
{
"__id__": 9
"__id__": 10
},
{
"__id__": 12
"__id__": 13
}
],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 15
"__id__": 16
},
"_opacity": 255,
"_color": {
......@@ -165,10 +165,13 @@
"_components": [
{
"__id__": 4
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 5
"__id__": 6
},
"_opacity": 102,
"_color": {
......@@ -249,6 +252,16 @@
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -271,11 +284,11 @@
"_active": false,
"_components": [
{
"__id__": 7
"__id__": 8
}
],
"_prefab": {
"__id__": 8
"__id__": 9
},
"_opacity": 255,
"_color": {
......@@ -329,7 +342,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
"__id__": 7
},
"_enabled": true,
"_materials": [
......@@ -386,11 +399,11 @@
"_active": false,
"_components": [
{
"__id__": 10
"__id__": 11
}
],
"_prefab": {
"__id__": 11
"__id__": 12
},
"_opacity": 255,
"_color": {
......@@ -444,7 +457,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
"__id__": 10
},
"_enabled": true,
"_materials": [
......@@ -499,11 +512,11 @@
"_active": false,
"_components": [
{
"__id__": 13
"__id__": 14
}
],
"_prefab": {
"__id__": 14
"__id__": 15
},
"_opacity": 255,
"_color": {
......@@ -557,7 +570,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -623,13 +636,13 @@
},
"_children": [
{
"__id__": 17
"__id__": 18
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 20
"__id__": 21
},
"_opacity": 255,
"_color": {
......@@ -683,17 +696,17 @@
"_name": "coin",
"_objFlags": 0,
"_parent": {
"__id__": 16
"__id__": 17
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 19
}
],
"_prefab": {
"__id__": 19
"__id__": 20
},
"_opacity": 255,
"_color": {
......@@ -747,7 +760,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
"__id__": 18
},
"_enabled": true,
"_clip": {
......
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