Commit 541a830e authored by Tt's avatar Tt

1

parent 98bf81c4
...@@ -230,6 +230,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -230,6 +230,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (!this.node_firetruck || !this.node_firetruck_anim || !this.node_firetruck_flush) { if (!this.node_firetruck || !this.node_firetruck_anim || !this.node_firetruck_flush) {
return pg.logger.w("消防车节点不存在"); return pg.logger.w("消防车节点不存在");
} }
pg.hw.playLocalAudio('car_in')
// 获取当前页码 // 获取当前页码
const currentPage = Game.getIns().getCurrentPageNum(); const currentPage = Game.getIns().getCurrentPageNum();
...@@ -398,6 +399,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -398,6 +399,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
async onTouchFireNode(e) { async onTouchFireNode(e) {
const fireNode = e.target; const fireNode = e.target;
pg.hw.playLocalAudio('fire_water');
// 保存触摸数据 // 保存触摸数据
this.touchData = fireNode.data; this.touchData = fireNode.data;
this.touchData.parent = fireNode; this.touchData.parent = fireNode;
...@@ -412,6 +414,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -412,6 +414,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
onFireSuccess() { onFireSuccess() {
pg.hw.playLocalAudio('score_success');
const fireNode = this.currentFireNode; const fireNode = this.currentFireNode;
// 从活跃火苗列表中移除当前火苗 --- 答题后操作 // 从活跃火苗列表中移除当前火苗 --- 答题后操作
const index = this.activeFireNodes.indexOf(fireNode); const index = this.activeFireNodes.indexOf(fireNode);
...@@ -454,6 +457,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -454,6 +457,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
} }
onFireFail() { onFireFail() {
pg.hw.playLocalAudio('score_fail');
const fireNode = this.currentFireNode; const fireNode = this.currentFireNode;
// 将火苗节点重新添加到活跃列表中,以便再次尝试 // 将火苗节点重新添加到活跃列表中,以便再次尝试
...@@ -577,9 +581,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -577,9 +581,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
let btn_start_reset = pg.view.find(this.layout_speak, 'btn_start_reset'); let btn_start_reset = pg.view.find(this.layout_speak, 'btn_start_reset');
let btn_stop = pg.view.find(this.layout_speak, 'btn_stop'); let btn_stop = pg.view.find(this.layout_speak, 'btn_stop');
let btn_record_replay = pg.view.find(this.layout_speak, 'btn_record_replay'); let btn_record_replay = pg.view.find(this.layout_speak, 'btn_record_replay');
let btn_record_0 = pg.view.find(this.layout_speak, 'btn_record_0');
let btn_record_1 = pg.view.find(this.layout_speak, 'btn_record_1');
let btn_record_2 = pg.view.find(this.layout_speak, 'btn_record_2');
let bg_card = pg.view.find(this.layout_speak, 'bg_card'); let bg_card = pg.view.find(this.layout_speak, 'bg_card');
let btn_voice = pg.view.find(bg_card, 'btn_voice'); let btn_voice = pg.view.find(bg_card, 'btn_voice');
let icon = pg.view.find(bg_card, 'icon'); let icon = pg.view.find(bg_card, 'icon');
...@@ -638,6 +639,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -638,6 +639,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 根据录音状态显示不同的按钮 // 根据录音状态显示不同的按钮
switch (recordState) { switch (recordState) {
case 'init': // 初始状态,未录制 case 'init': // 初始状态,未录制
pg.hw.playLocalAudio('pop_card');
btn_start.active = true; btn_start.active = true;
btn_stop.active = false; btn_stop.active = false;
btn_start_reset.active = false; btn_start_reset.active = false;
......
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