Commit 3ce0f3f5 authored by Tt's avatar Tt

修改提交

parent 3cbb15a6
......@@ -11,6 +11,7 @@ const { ccclass, property } = cc._decorator;
export default class LayerBack extends cc.Component {
private btn_back: cc.Node;
private img_npc_voice: cc.Node;
private bg_forbid: cc.Node;
onLoad() {
this.initView();
this.initEvent();
......@@ -19,6 +20,7 @@ export default class LayerBack extends cc.Component {
initView() {
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')
this.img_npc_voice = pg.view.find(this.label_title, 'img_npc_voice')
......@@ -27,8 +29,8 @@ export default class LayerBack extends cc.Component {
private npcTitle: string;
private npcAudio: string;
updateView(data) {
this.npcTitle = data.npcTitle || '';
this.npcAudio = data.npcAudio || '';
this.npcTitle = data.npcTitle
this.npcAudio = data.npcAudio
pg.view.visible(this.img_npc_voice, this.npcAudio)
pg.view.visible(this.label_title, this.npcTitle)
pg.view.setString(this.label_title, this.npcTitle);
......@@ -38,6 +40,7 @@ export default class LayerBack extends cc.Component {
pg.event.on('npc_layer_back_init', (data) => {
this.updateView(data);
if (!this.npcAudio) {
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end');
} else {
this.playVoiceStart();
......@@ -55,6 +58,7 @@ export default class LayerBack extends cc.Component {
this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.playVoiceEnd();
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
......
......@@ -21,20 +21,23 @@
"__id__": 2
},
{
"__id__": 7
"__id__": 6
},
{
"__id__": 11
}
],
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 27
},
{
"__id__": 23
"__id__": 28
}
],
"_prefab": {
"__id__": 24
"__id__": 29
},
"_opacity": 255,
"_color": {
......@@ -85,7 +88,7 @@
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_name": "bg_forbid",
"_objFlags": 0,
"_parent": {
"__id__": 1
......@@ -98,13 +101,128 @@
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
},
"fileId": "07DTTDThBNdJCrgpsUtJSh",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
},
{
"__id__": 8
},
{
"__id__": 5
"__id__": 9
}
],
"_prefab": {
"__id__": 6
"__id__": 10
},
"_opacity": 255,
"_color": {
......@@ -158,7 +276,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"_materials": [
......@@ -190,7 +308,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"_normalMaterial": null,
......@@ -258,7 +376,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"alignMode": 1,
......@@ -300,17 +418,20 @@
},
"_children": [
{
"__id__": 8
"__id__": 12
}
],
"_active": true,
"_components": [
{
"__id__": 20
"__id__": 24
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 21
"__id__": 26
},
"_opacity": 255,
"_color": {
......@@ -364,27 +485,27 @@
"_name": "img_npc_voice",
"_objFlags": 0,
"_parent": {
"__id__": 7
"__id__": 11
},
"_children": [
{
"__id__": 9
"__id__": 13
},
{
"__id__": 12
"__id__": 16
},
{
"__id__": 15
"__id__": 19
}
],
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 22
}
],
"_prefab": {
"__id__": 19
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -438,17 +559,17 @@
"_name": "p1",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 14
}
],
"_prefab": {
"__id__": 11
"__id__": 15
},
"_opacity": 255,
"_color": {
......@@ -502,7 +623,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -545,17 +666,17 @@
"_name": "p2",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 13
"__id__": 17
}
],
"_prefab": {
"__id__": 14
"__id__": 18
},
"_opacity": 255,
"_color": {
......@@ -609,7 +730,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -652,17 +773,17 @@
"_name": "p3",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 16
"__id__": 20
}
],
"_prefab": {
"__id__": 17
"__id__": 21
},
"_opacity": 255,
"_color": {
......@@ -716,7 +837,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -759,7 +880,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 12
},
"_enabled": true,
"alignMode": 2,
......@@ -797,7 +918,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 11
},
"_enabled": true,
"_materials": [
......@@ -827,6 +948,33 @@
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 274.52700000000004,
"_right": 0,
"_top": 67.39999999999998,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
......
......@@ -11,7 +11,7 @@
"height": 117,
"platformSettings": {},
"subMetas": {
"back_hy11_paopao": {
"back_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "92327074-92fd-4d4a-a8aa-32f7ed514ab1",
"rawTextureUuid": "d3006e79-2315-4059-8aee-8e7a4d56121f",
......
......@@ -11,7 +11,7 @@
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger1_hy11_paopao": {
"pic_icon_tiger1_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "008bbd55-b1e7-4e82-bf54-f6cf40ebb738",
"rawTextureUuid": "593366d0-c41f-40dd-8cfa-72e2fbdb78b8",
......
......@@ -11,7 +11,7 @@
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger2_hy11_paopao": {
"pic_icon_tiger2_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "603d0882-deba-4173-8432-b9da5e547d20",
"rawTextureUuid": "f6f170f4-59de-40e0-b666-1ddaf58a6997",
......
......@@ -11,7 +11,7 @@
"height": 70,
"platformSettings": {},
"subMetas": {
"pic_icon_tiger_hy11_paopao": {
"pic_icon_tiger_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "5d214bcc-ae6a-48b2-8e3e-693089d66911",
"rawTextureUuid": "ffa50fcc-6561-4673-8e93-5e4abf03d963",
......
......@@ -21,7 +21,8 @@ export default class LayerEnding extends cc.Component {
pg.view.touchOn(this.replay_btn, this.onTouchReplay, this)
pg.view.touchOn(this.next_btn, this.onTouchNext, this)
pg.event.on('layer_ending_show', (data) => {
this.showLayer(data);
// this.showLayer(data);
this.onTouchNext();
})
}
showLayer(data) {
......
This diff is collapsed.
......@@ -13,8 +13,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
let audios = [];
function checkAudio(obj) {
for (let idx in obj) {
if (typeof obj[idx] == "object") {
checkAudio(obj[idx]);
} else if (typeof obj[idx] == "string") {
if (obj[idx].indexOf(".mp3") > -1) audios.push(obj[idx]);
}
}
}
checkAudio(this.data)
this._audioResList = audios;
}
addPreloadAnima() {
......@@ -188,7 +198,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.hw.playLocalAudio('error')
// 失败 泡泡左右微晃两次
cc.tween(pg.view.find(item, 'bubble'))
.to(0.1, { x: -5 }).to(0.1, { x: 0 }).to(0.1, { x: 5 }).to(0.1, { x: 0 })
.to(0.1, { x: -15 })
.to(0.1, { x: 0 })
.to(0.1, { x: 15 })
.to(0.1, { x: 0 })
.start()
}
}
......
export const defaultData =
{
"onlineFlg": false,
"title": "钓鱼大作战", "questionText": "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", "questionTextAudio": "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", "questions": [{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "duration": 120,
"options": [
{
"type": "img", "image": "http://staging-teach.cdn.ireadabc.com/7782399d0ad0b9578b2109c620d64465.png", "audio": "", "text": "", "right": true
},
{
"type": "img", "image": "http://staging-teach.cdn.ireadabc.com/e283a9417dbb578b83c05c5969b4865b.png", "audio": "", "text": "", "right": true
}], "audioName": "ready go.mp3"
},
{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/cb76dbc838567b58e2af36e2d2faa923_l.mp3", "duration": 120, "options": [{ "type": "txt", "image": "", "audio": "", "text": "push", "right": false }, { "type": "txt", "image": "", "audio": "", "text": "monkey", "right": true }, { "type": "txt", "image": "", "audio": "", "text": "book", "right": true }, { "type": "txt", "image": "", "audio": "", "text": "bee", "right": false }
], "audioName": "图片卡片出现.mp3"
}], "bgAudio": "", "bgAudioName": "", "audioName": ""
"recordFlag": false,
"title": "",
"questionText": "",
"questionTextAudio": "",
"questions": [
{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/172fad3743476ac9c668eb8a82d5eca1_l.mp3",
"duration": 120,
"options": [
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/e921b21c9ac22a623497b79cf849a421.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": true
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "bad",
"duration": "",
"content": "",
"right": true
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "old",
"duration": "",
"content": "",
"right": false
},
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/a56eecb3dd57ef0aca8c52c721717ed5.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": false
},
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/e184e067fc931d55fce93c9937a26c51.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": false
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "Beijing Opera",
"duration": "",
"content": "",
"right": false
}
],
"audioName": "bad.mp3"
},
{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/81c8ea51c42136db0fd61e78c38de7c9_l.mp3",
"duration": 120,
"options": [
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/a56eecb3dd57ef0aca8c52c721717ed5.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": true
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "Beijing Opera",
"duration": "",
"content": "",
"right": true
},
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/b5f8a61a803e3d7b26b767959ff21e6b.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": false
},
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/e184e067fc931d55fce93c9937a26c51.png",
"audio": "",
"text": "",
"duration": "",
"content": "",
"right": false
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "somersault",
"duration": "",
"content": "",
"right": false
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "bad",
"duration": "",
"content": "",
"right": false
}
],
"audioName": "Beijing Opera.mp3"
}
],
"bgAudio": "",
"bgAudioName": "",
"audioName": "",
"npcTitle": "Warm UP",
"npcAudio": "http://staging-teach.cdn.ireadabc.com/cd8faccc65b1b6f89badcc87898a0559_l.mp3",
"npcAudioName": "HY11欢乐泡泡-听音并选择你认为正确的答案.mp3"
}
// {
// "onlineFlg": false,
// "title": "钓鱼大作战", "questionText": "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", "questionTextAudio": "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", "questions": [{
// "questionAudio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "duration": 120,
// "options": [
// {
// "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/7782399d0ad0b9578b2109c620d64465.png", "audio": "", "text": "", "right": true
// },
// {
// "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/e283a9417dbb578b83c05c5969b4865b.png", "audio": "", "text": "", "right": true
// }], "audioName": "ready go.mp3"
// },
// {
// "questionAudio": "http://staging-teach.cdn.ireadabc.com/cb76dbc838567b58e2af36e2d2faa923_l.mp3", "duration": 120, "options": [{ "type": "txt", "image": "", "audio": "", "text": "push", "right": false }, { "type": "txt", "image": "", "audio": "", "text": "monkey", "right": true }, { "type": "txt", "image": "", "audio": "", "text": "book", "right": true }, { "type": "txt", "image": "", "audio": "", "text": "bee", "right": false }
// ], "audioName": "图片卡片出现.mp3"
// }], "bgAudio": "", "bgAudioName": "", "audioName": ""
// }
// {
// "recordFlag": true,
// "title": "test",
......
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