Commit 788b2573 authored by yu's avatar yu

背景音乐

parent 88a1d772
...@@ -94,18 +94,24 @@ ...@@ -94,18 +94,24 @@
}, },
{ {
"__id__": 72 "__id__": 72
},
{
"__id__": 114
},
{
"__id__": 117
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 114 "__id__": 120
}, },
{ {
"__id__": 115 "__id__": 121
}, },
{ {
"__id__": 116 "__id__": 122
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5408,7 +5414,7 @@ ...@@ -5408,7 +5414,7 @@
"_target": null, "_target": null,
"_alignFlags": 4, "_alignFlags": 4,
"_left": 0, "_left": 0,
"_right": 0, "_right": 59.240999999999985,
"_top": 0, "_top": 0,
"_bottom": 23.30200000000002, "_bottom": 23.30200000000002,
"_verticalCenter": 0, "_verticalCenter": 0,
...@@ -5491,6 +5497,254 @@ ...@@ -5491,6 +5497,254 @@
"_N$target": null, "_N$target": null,
"_id": "c8kRozKopEh7SAB4DVv44g" "_id": "c8kRozKopEh7SAB4DVv44g"
}, },
{
"__type__": "cc.Node",
"_name": "hl_bg_audio_off",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 115
},
{
"__id__": 116
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 92,
"height": 92
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-561,
-300.636,
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": "8bLwffR7JABqPmEqir2m5g"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0d9e6a0b-15d1-4311-8897-df7aba23ed50"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5eiPZB3UhGUZoiUSQ6wmRF"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 60,
"_right": 0,
"_top": 0,
"_bottom": 28.363999999999976,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "62JEo3TAVDio0zG60WrS2q"
},
{
"__type__": "cc.Node",
"_name": "hl_bg_audio_on",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 118
},
{
"__id__": 119
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 92,
"height": 92
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-561,
-300.636,
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": "a6zN6TYMtJeJ/gAQ+lH05Z"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ea341834-ce4d-4882-93bd-837c6b54f1cd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "77bHf0qOVJCoNpa2hQhlC5"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 60,
"_right": 0,
"_top": 0,
"_bottom": 28.363999999999976,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "6a1pjkliJJt5nDNKcGNXjx"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
...@@ -5554,6 +5808,12 @@ ...@@ -5554,6 +5808,12 @@
"btn_laba": { "btn_laba": {
"__id__": 105 "__id__": 105
}, },
"btn_audio_off": {
"__id__": 114
},
"btn_audio_on": {
"__id__": 117
},
"_id": "8bPdkfFS9F8bOmPlsaKJDw" "_id": "8bPdkfFS9F8bOmPlsaKJDw"
} }
] ]
\ No newline at end of file
import { asyncDelay, onHomeworkFinish } from "../script/util"; import { asyncDelay, onHomeworkFinish } from "../script/util_firepower_fort";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_firepower_fort";
import Game, { FISH_OUT, GAME_STATE, Option } from "./tool/Game"; import Game, { FISH_OUT, GAME_STATE, Option } from "./tool/Game_firepower_fort";
import pg from "./tool/pg"; import pg from "./tool/pg_firepower_fort";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -77,6 +77,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -77,6 +77,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
layout_cannon: cc.Node = null; layout_cannon: cc.Node = null;
@property(cc.Node) @property(cc.Node)
btn_laba: cc.Node = null; btn_laba: cc.Node = null;
@property(cc.Node)
btn_audio_off: cc.Node = null;
@property(cc.Node)
btn_audio_on: cc.Node = null;
_cantouch = null; _cantouch = null;
initData() { initData() {
...@@ -109,12 +113,20 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -109,12 +113,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
touch.on(cc.Node.EventType.TOUCH_END, () => { touch.on(cc.Node.EventType.TOUCH_END, () => {
cc.audioEngine.stopAllEffects(); cc.audioEngine.stopAllEffects();
pg.audio.stopAudio(this.audioId); pg.audio.stopAudio(this.audioId);
pg.audio.playAudioByUrl(Game.getIns().question.audio); pg.audio.playAudioByUrl(Game.getIns().question.audio).then((audioId) => {
this.audioId = audioId;
if (audioId > -1 && Game.getIns().state == GAME_STATE.RUNNING) pg.audio.stopAudio(audioId);
});
}) })
if (Game.getIns().bgAudio || Game.getIns().bgAudio != "") {
this.btn_audio_on.active = true;
}
} }
initEvent() { initEvent() {
pg.view.touchOn(pg.view.find(this.layout_start, 'btn_start'), this.onTouchStart, this); pg.view.touchOn(pg.view.find(this.layout_start, 'btn_start'), this.onTouchStart, this);
this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this); this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this);
this.btn_audio_off.on(cc.Node.EventType.TOUCH_END, this.onAudioOff, this);
this.btn_audio_on.on(cc.Node.EventType.TOUCH_END, this.onAudioOn, this);
pg.event.on("game_start", () => { pg.event.on("game_start", () => {
this.gameStart(); this.gameStart();
...@@ -146,9 +158,33 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -146,9 +158,33 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
onTouchStart() { onTouchStart() {
pg.audio.playLocalAudio(cc.find(`Canvas/res/audio/btn`)); pg.audio.playLocalAudio(cc.find(`Canvas/res/audio/btn`));
if (this.audioId > -1) {
pg.audio.stopAudio(this.audioId);
}
pg.audio.playBgAudioByUrl(Game.getIns().bgAudio);
pg.event.emit("game_start"); pg.event.emit("game_start");
} }
private isPlayBgAudio: boolean;
private onAudioOn() {
this.btn_audio_off.active = true;
this.btn_audio_on.active = false;
this.isPlayBgAudio = false;
this.stopBgAudio();
}
private onAudioOff() {
this.btn_audio_on.active = true;
this.btn_audio_off.active = false;
this.isPlayBgAudio = true;
this.playBgAudio();
}
private playBgAudio() {
if (!this.isPlayBgAudio) return;
cc.audioEngine.resumeMusic();
}
private stopBgAudio() {
cc.audioEngine.pauseMusic();
}
private count: number; private count: number;
private list: Option[]; private list: Option[];
...@@ -158,7 +194,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -158,7 +194,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
//游戏开始小鱼出现等等 //游戏开始小鱼出现等等
this.layout_start.active = false; this.layout_start.active = false;
if (this.audioId > -1 && Game.getIns().state != GAME_STATE.WAIT) { if (this.audioId > -1 && Game.getIns().state != GAME_STATE.WAIT) {
cc.audioEngine.stopAllEffects(); // cc.audioEngine.stopAllEffects();
pg.audio.stopAudio(this.audioId); pg.audio.stopAudio(this.audioId);
} }
//开始 //开始
...@@ -195,12 +231,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -195,12 +231,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
}) })
} }
private intervalId; private intervalId;
private questionAudioId = -1;
private playLaba() { private playLaba() {
let btn_kaba2 = this.btn_laba.getChildByName("btn_laba2"); let btn_kaba2 = this.btn_laba.getChildByName("btn_laba2");
let btn_kaba3 = this.btn_laba.getChildByName("btn_laba3"); let btn_kaba3 = this.btn_laba.getChildByName("btn_laba3");
if (this.questionAudioId > -1) pg.audio.stopAudio(this.questionAudioId);
btn_kaba2.active = true; btn_kaba2.active = true;
btn_kaba3.active = true; btn_kaba3.active = true;
cc.audioEngine.stopAllEffects(); // cc.audioEngine.stopAllEffects();
let count = 0; let count = 0;
if (this.intervalId) clearInterval(this.intervalId); if (this.intervalId) clearInterval(this.intervalId);
let stop = false; let stop = false;
...@@ -213,8 +251,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -213,8 +251,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.audio.playAudioByUrl(Game.getIns().getCurrentPage().audio, () => { pg.audio.playAudioByUrl(Game.getIns().getCurrentPage().audio, () => {
stop = true; stop = true;
}).then(() => { }) }).then((audioId: number) => {
this.questionAudioId = audioId;
})
} }
} }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import Game, { GAME_STATE, Option } from "../tool/Game"; import Game, { GAME_STATE, Option } from "../tool/Game_firepower_fort";
import pg from "../tool/pg"; import pg from "../tool/pg_firepower_fort";
pg.event.clear(); pg.event.clear();
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// // Learn life-cycle callbacks: // // Learn life-cycle callbacks:
// // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
// import Game, { FISH_OUT, GAME_STATE, Option } from "../tool/Game"; // import Game, { FISH_OUT, GAME_STATE, Option } from "../tool/Game_firepower_fort";
// import pg from "../tool/pg"; // import pg from "../tool/pg_firepower_fort";
// const { ccclass, property } = cc._decorator; // const { ccclass, property } = cc._decorator;
...@@ -249,3 +249,4 @@ ...@@ -249,3 +249,4 @@
// if (fish) this.fishs.push(fish); // if (fish) this.fishs.push(fish);
// } // }
// } // }
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import Game, { GAME_STATE } from "../tool/Game"; import Game, { GAME_STATE } from "../tool/Game_firepower_fort";
import pg from "../tool/pg"; import pg from "../tool/pg_firepower_fort";
pg.event.clear(); pg.event.clear();
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
......
import { count } from "console"; import { count } from _firepower_fort"console";
export enum FISH_OUT { export enum FISH_OUT {
RUNNING, RUNNING,
...@@ -145,10 +145,12 @@ export default class Game { ...@@ -145,10 +145,12 @@ export default class Game {
public question: { text, audio }; public question: { text, audio };
public title: string; public title: string;
public questionText: string; public questionText: string;
public bgAudio: string;
public init(data) { public init(data) {
this.singleGame = !data.onlineFlg; this.singleGame = !data.onlineFlg;
this.question = { text: data.questionText, audio: data.questionTextAudio }; this.question = { text: data.questionText, audio: data.questionTextAudio };
this.title = data.title; this.title = data.title;
this.bgAudio = data.bgAudio || "";
this.questionText = data.questionText; this.questionText = data.questionText;
this.start = false; this.start = false;
this.lists = []; this.lists = [];
......
...@@ -524,7 +524,7 @@ let pg = { ...@@ -524,7 +524,7 @@ let pg = {
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => { cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
cb && cb(); cb && cb(audioId);
}); });
loadCb && loadCb(audioId); loadCb && loadCb(audioId);
resolve(audioId); resolve(audioId);
...@@ -532,7 +532,7 @@ let pg = { ...@@ -532,7 +532,7 @@ let pg = {
}); });
}, },
stopAudio(audioId) { stopAudio(audioId) {
if (!audioId) return; if (audioId < 0) return;
cc.audioEngine.stopEffect(audioId); cc.audioEngine.stopEffect(audioId);
}, },
playAudio(audioClip, cb = null) { playAudio(audioClip, cb = null) {
...@@ -562,7 +562,20 @@ let pg = { ...@@ -562,7 +562,20 @@ let pg = {
resolve(audioClip); resolve(audioClip);
}); });
}); });
} },
playBgAudioByUrl(audio_url, cb = null, loadCb = null) {
return new Promise((resolve, reject) => {
if (!audio_url) return resolve(null);
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
const audioId = cc.audioEngine.playMusic(audioClip, true);
cc.audioEngine.setFinishCallback(audioId, () => {
cb && cb();
});
loadCb && loadCb(audioId);
resolve(audioId);
});
});
},
}, },
time: { time: {
......
import { defaultData } from "../script/defaultData"; import { defaultData } from "../script/defaultData_firepower_fort";
export class MyCocosSceneComponent extends cc.Component { export class MyCocosSceneComponent extends cc.Component {
......
...@@ -2,6 +2,7 @@ export const defaultData = { ...@@ -2,6 +2,7 @@ export const defaultData = {
"title": "热气球大战", "title": "热气球大战",
"questionText": "可恶的小偷将魔法卡牌藏在热气球里,准备偷走!快击落热气球,夺回魔法卡牌。游戏开始,请点击弹弓,发射小球,击落热气球,魔法卡牌就会掉落下来。请仔细观察魔法卡牌,并大声说出魔法咒语。魔法咒语正确,你将获得该张魔法卡牌。游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!", "questionText": "可恶的小偷将魔法卡牌藏在热气球里,准备偷走!快击落热气球,夺回魔法卡牌。游戏开始,请点击弹弓,发射小球,击落热气球,魔法卡牌就会掉落下来。请仔细观察魔法卡牌,并大声说出魔法咒语。魔法咒语正确,你将获得该张魔法卡牌。游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
"questionTextAudio": "https://staging-teach.cdn.ireadabc.com/3152e0ea17b07406a002b2c05028b0cc.mp3", "questionTextAudio": "https://staging-teach.cdn.ireadabc.com/3152e0ea17b07406a002b2c05028b0cc.mp3",
"bgAudio": "https://staging-teach.cdn.ireadabc.com/ed84c18cc5f696ceaaf488ff98c228fe_l.mp3",
"questions": [ "questions": [
{ {
"questionAudio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3", "questionAudio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 336, "height": 336,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "1orange_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "fd323ad8-460a-49b0-b4f7-0bce76e27958", "uuid": "fd323ad8-460a-49b0-b4f7-0bce76e27958",
"rawTextureUuid": "d01122b3-78b7-4e27-948c-7c3db83be3f2", "rawTextureUuid": "d01122b3-78b7-4e27-948c-7c3db83be3f2",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 683, "height": 683,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_bg": { "bg_bg_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "7faa5af6-999b-480b-a721-ea3af54af00a", "uuid": "7faa5af6-999b-480b-a721-ea3af54af00a",
"rawTextureUuid": "67c8af96-5932-4524-a65f-aaaefe51b91e", "rawTextureUuid": "67c8af96-5932-4524-a65f-aaaefe51b91e",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 243, "height": 243,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_cannon-front": { "bg_cannonfront_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ed255505-bd8a-46bd-b5db-58766adfa502", "uuid": "ed255505-bd8a-46bd-b5db-58766adfa502",
"rawTextureUuid": "316927cb-f4f6-47aa-9b0c-3dde222e9735", "rawTextureUuid": "316927cb-f4f6-47aa-9b0c-3dde222e9735",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 243, "height": 243,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_cannon-left": { "bg_cannonleft_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "4845501e-631f-4923-8119-521e4a0e9a19", "uuid": "4845501e-631f-4923-8119-521e4a0e9a19",
"rawTextureUuid": "412ec62f-c4dc-4600-a6ad-f78b580d90fe", "rawTextureUuid": "412ec62f-c4dc-4600-a6ad-f78b580d90fe",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 243, "height": 243,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_cannon-right": { "bg_cannonright_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "754846ce-196b-48b9-9c9d-0252c1ca81e1", "uuid": "754846ce-196b-48b9-9c9d-0252c1ca81e1",
"rawTextureUuid": "963cc926-14a9-454a-9b57-da697c08151d", "rawTextureUuid": "963cc926-14a9-454a-9b57-da697c08151d",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 319, "height": 319,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_di": { "bg_di_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "c18f7aa2-458c-4246-b9e0-ed37b42a6ed2", "uuid": "c18f7aa2-458c-4246-b9e0-ed37b42a6ed2",
"rawTextureUuid": "601d7183-91cb-4e66-a7d5-a6ef48a9e014", "rawTextureUuid": "601d7183-91cb-4e66-a7d5-a6ef48a9e014",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 104, "height": 104,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_front": { "bg_front_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "79d78ea5-badd-4d52-b0ee-1d3e5c305b4f", "uuid": "79d78ea5-badd-4d52-b0ee-1d3e5c305b4f",
"rawTextureUuid": "ea684ff8-611c-44d4-9ecf-6b2461a5b9c9", "rawTextureUuid": "ea684ff8-611c-44d4-9ecf-6b2461a5b9c9",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 330, "height": 330,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_pic": { "bg_pic_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "3720fcdc-776d-4e12-bf80-94078906704a", "uuid": "3720fcdc-776d-4e12-bf80-94078906704a",
"rawTextureUuid": "8aa357b8-35fa-424a-8882-1e7b4c2d4fee", "rawTextureUuid": "8aa357b8-35fa-424a-8882-1e7b4c2d4fee",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 330, "height": 330,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_pic-right": { "bg_picright_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "78714de0-4076-4950-bb2c-035d3d1dd6a8", "uuid": "78714de0-4076-4950-bb2c-035d3d1dd6a8",
"rawTextureUuid": "5bf835f7-e9c9-4e30-892f-b74dbf973cff", "rawTextureUuid": "5bf835f7-e9c9-4e30-892f-b74dbf973cff",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 750, "height": 750,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_sky": { "bg_sky_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "42f24278-f2a5-4f54-a2ce-a70e0f467e1e", "uuid": "42f24278-f2a5-4f54-a2ce-a70e0f467e1e",
"rawTextureUuid": "edeba0eb-ca42-46b9-aeac-a5a8e0d45231", "rawTextureUuid": "edeba0eb-ca42-46b9-aeac-a5a8e0d45231",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 111, "height": 111,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_title": { "bg_title_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "b348fe13-1598-4c41-b4d3-ddf0646cc16c", "uuid": "b348fe13-1598-4c41-b4d3-ddf0646cc16c",
"rawTextureUuid": "fbda8bf0-581c-46b0-a6f7-68b4c21dea2b", "rawTextureUuid": "fbda8bf0-581c-46b0-a6f7-68b4c21dea2b",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 355, "height": 355,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_word": { "bg_word_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e2c7cf44-05b9-435b-aee4-b972856cb92e", "uuid": "e2c7cf44-05b9-435b-aee4-b972856cb92e",
"rawTextureUuid": "3a7a8adb-34f1-44cb-97d0-d180c982cb05", "rawTextureUuid": "3a7a8adb-34f1-44cb-97d0-d180c982cb05",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 355, "height": 355,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_word-right": { "bg_wordright_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1f322b82-f55e-4c2c-8ed7-9ce163ab64b9", "uuid": "1f322b82-f55e-4c2c-8ed7-9ce163ab64b9",
"rawTextureUuid": "9dce06b9-c218-41b7-a0a7-f0c8e99d51c9", "rawTextureUuid": "9dce06b9-c218-41b7-a0a7-f0c8e99d51c9",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 98, "height": 98,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_laba2": { "btn_laba2_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1bed66da-4e54-415f-b652-f0d68cdb8561", "uuid": "1bed66da-4e54-415f-b652-f0d68cdb8561",
"rawTextureUuid": "c038ec80-2c68-4b2d-90d9-856a389ab736", "rawTextureUuid": "c038ec80-2c68-4b2d-90d9-856a389ab736",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 98, "height": 98,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_laba3": { "btn_laba3_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1f2666b5-07ce-4edb-949e-3d18204140e3", "uuid": "1f2666b5-07ce-4edb-949e-3d18204140e3",
"rawTextureUuid": "56112314-8e24-460f-b3f5-8fbfdb58f582", "rawTextureUuid": "56112314-8e24-460f-b3f5-8fbfdb58f582",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 98, "height": 98,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_laba": { "btn_laba_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "b81cb9d6-1734-46ff-85a9-778a9c22323c", "uuid": "b81cb9d6-1734-46ff-85a9-778a9c22323c",
"rawTextureUuid": "302d3355-a421-429a-b587-67ce86011f02", "rawTextureUuid": "302d3355-a421-429a-b587-67ce86011f02",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 114, "height": 114,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_restart": { "btn_restart_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "4986c610-4001-4384-aa63-328485ad5283", "uuid": "4986c610-4001-4384-aa63-328485ad5283",
"rawTextureUuid": "15e4e1a5-d5de-4278-93c1-26b2a759dc79", "rawTextureUuid": "15e4e1a5-d5de-4278-93c1-26b2a759dc79",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 114, "height": 114,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_start": { "btn_start_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "dc8c3186-7bcf-4854-b150-0640e580a7a1", "uuid": "dc8c3186-7bcf-4854-b150-0640e580a7a1",
"rawTextureUuid": "a2f8f528-33de-4522-af7b-1948b4696d2f", "rawTextureUuid": "a2f8f528-33de-4522-af7b-1948b4696d2f",
......
{
"ver": "2.3.5",
"uuid": "78f66918-5635-41e1-bebf-e0eaedf6ed33",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 92,
"height": 92,
"platformSettings": {},
"subMetas": {
"hl_bg_audio_off_firepower_fort": {
"ver": "1.0.4",
"uuid": "0d9e6a0b-15d1-4311-8897-df7aba23ed50",
"rawTextureUuid": "78f66918-5635-41e1-bebf-e0eaedf6ed33",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 92,
"height": 92,
"rawWidth": 92,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6659cf24-2777-46e9-a547-fff30f31542b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 92,
"height": 92,
"platformSettings": {},
"subMetas": {
"hl_bg_audio_on_firepower_fort": {
"ver": "1.0.4",
"uuid": "ea341834-ce4d-4882-93bd-837c6b54f1cd",
"rawTextureUuid": "6659cf24-2777-46e9-a547-fff30f31542b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 92,
"height": 92,
"rawWidth": 92,
"rawHeight": 92,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 86, "height": 86,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon_arrow": { "icon_arrow_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "91156914-91be-46d7-8c5f-23d1cd8dbb9b", "uuid": "91156914-91be-46d7-8c5f-23d1cd8dbb9b",
"rawTextureUuid": "1d8fdf60-f8d1-42c4-b79f-02d8c17f47f8", "rawTextureUuid": "1d8fdf60-f8d1-42c4-b79f-02d8c17f47f8",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 104, "height": 104,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon_shell": { "icon_shell_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "0c0dc4a1-ed3d-4260-ba68-ff900f727282", "uuid": "0c0dc4a1-ed3d-4260-ba68-ff900f727282",
"rawTextureUuid": "5cbe63aa-03fd-4eec-b498-3981ab1035ca", "rawTextureUuid": "5cbe63aa-03fd-4eec-b498-3981ab1035ca",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 23, "height": 23,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon_shell-wrong": { "icon_shellwrong_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1e7a45e2-7b9f-496a-9a15-22c87b2ba79c", "uuid": "1e7a45e2-7b9f-496a-9a15-22c87b2ba79c",
"rawTextureUuid": "27ae9558-12bd-42ad-bead-5a494ed37365", "rawTextureUuid": "27ae9558-12bd-42ad-bead-5a494ed37365",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 720, "height": 720,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "bg_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "5da9eb1a-9ddc-4fef-af67-06ac6b01bf73", "uuid": "5da9eb1a-9ddc-4fef-af67-06ac6b01bf73",
"rawTextureUuid": "98369e50-e669-445c-98e0-b126a81ea059", "rawTextureUuid": "98369e50-e669-445c-98e0-b126a81ea059",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 67, "height": 67,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "btn_left_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "3efdbf0a-338b-454f-8102-6b5defd4c31b", "uuid": "3efdbf0a-338b-454f-8102-6b5defd4c31b",
"rawTextureUuid": "617be2a0-c100-44e7-bc0b-ab651b912d15", "rawTextureUuid": "617be2a0-c100-44e7-bc0b-ab651b912d15",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 67, "height": 67,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "btn_right_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "eb04d90f-d67c-49f8-a559-23d477eeeb8b", "uuid": "eb04d90f-d67c-49f8-a559-23d477eeeb8b",
"rawTextureUuid": "a12013d9-72b0-4478-a0ba-d311b64bcdcd", "rawTextureUuid": "a12013d9-72b0-4478-a0ba-d311b64bcdcd",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 144, "height": 144,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon": { "icon_firepower_fort": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1de0daeb-9695-4ce4-80cc-78bd037807f2", "uuid": "1de0daeb-9695-4ce4-80cc-78bd037807f2",
"rawTextureUuid": "159314d2-d34b-46aa-97d6-b8d6a8cc80d6", "rawTextureUuid": "159314d2-d34b-46aa-97d6-b8d6a8cc80d6",
......
...@@ -66,12 +66,12 @@ export class ComponentBase { ...@@ -66,12 +66,12 @@ export class ComponentBase {
* 储存音频数据 * 储存音频数据
* @param e * @param e
*/ */
onAudioUploadSuccess(e, key, it = this.item) { onAudioUploadSuccess(e, key, it = this.item, audioName) {
let url = e.url; let url = e.url;
let sp = url.split(".mp3"); let sp = url.split(".mp3");
let u = sp[0] + "_l.mp3"; let u = sp[0] + "_l.mp3";
it[key] = u; it[key] = u;
it["audioName"] = e.name || ""; it[audioName] = e.name || "";
this.save(); this.save();
} }
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<div style="display:flex ;"> <div style="display:flex ;">
<div> <div>
<app-audio-recorder [audioUrl]="item.questionTextAudio" <app-audio-recorder [audioUrl]="item.questionTextAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio')"></app-audio-recorder> (audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio',item,'audioName')"></app-audio-recorder>
</div> </div>
<div style="margin: 5px"> <div style="margin: 5px">
<span>{{ item.audioName}}</span> <span>{{ item.audioName}}</span>
...@@ -92,6 +92,32 @@ ...@@ -92,6 +92,32 @@
</div> </div>
</div> </div>
<div class="border-dashed" style="margin: 20px;width: 1080px;">
<div class="word-input-title">
<div>
<span>游戏背景音乐: </span>
</div>
<div>
<span style="color:rgb(201, 200, 200);margin-left:5px;font-size: 10px;"> *可不传,不传既无背景音乐</span>
</div>
</div>
<div style="display:flex ;margin-top: 10px;">
<div>
<app-audio-recorder [audioUrl]="item.bgAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'bgAudio',item,'bgAudioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.bgAudioName}}</span>
</div>
<div style="margin: 5px">
<span style="color: #169BD5;text-decoration: underline;" type="button" nzDanger
(click)="deleteBgAudio()">删除背景音</span>
</div>
</div>
</div>
<div style="margin: 20px;width: 1000px;"> <div style="margin: 20px;width: 1000px;">
<div *ngFor="let question of item.questions; let i = index"> <div *ngFor="let question of item.questions; let i = index">
<div style="display: flex;margin-top: 20px;"> <div style="display: flex;margin-top: 20px;">
...@@ -106,7 +132,7 @@ ...@@ -106,7 +132,7 @@
<div style="display:flex ;"> <div style="display:flex ;">
<div> <div>
<app-audio-recorder [audioUrl]="question.questionAudio" <app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionAudio',question)"> (audioUploaded)="onAudioUploadSuccess($event, 'questionAudio',question,'audioName')">
</app-audio-recorder> </app-audio-recorder>
</div> </div>
<div style="margin: 5px"> <div style="margin: 5px">
...@@ -168,7 +194,7 @@ ...@@ -168,7 +194,7 @@
<div style="display: flex"> <div style="display: flex">
<div> <div>
<app-audio-recorder [audioUrl]="option.audio" <app-audio-recorder [audioUrl]="option.audio"
(audioUploaded)="onAudioUploadSuccess($event, 'audio', option)"> (audioUploaded)="onAudioUploadSuccess($event, 'audio', option,'audioName')">
</app-audio-recorder> </app-audio-recorder>
</div> </div>
<div style="margin: 5px"> <div style="margin: 5px">
......
...@@ -16,7 +16,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -16,7 +16,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
questionText: "敌人建造了很多炮塔在我们的地盘上,真是太危险了! 亲爱的小玩家,请认真听游戏指令,利用小炮台摧毁这些炮塔吧!游戏结束后,根据摧毁的炮塔数量,你将获得相应的能量石奖励哟!开始挑战吧!", questionText: "敌人建造了很多炮塔在我们的地盘上,真是太危险了! 亲爱的小玩家,请认真听游戏指令,利用小炮台摧毁这些炮塔吧!游戏结束后,根据摧毁的炮塔数量,你将获得相应的能量石奖励哟!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/8b8983df3ead9128f029c7a1a1e5c524_l.mp3", questionTextAudio: "http://staging-teach.cdn.ireadabc.com/8b8983df3ead9128f029c7a1a1e5c524_l.mp3",
questions: [], questions: [],
audioName:"" audioName:"",
bgAudio: "",
bgAudioName: "",
}; };
isVisible = false; isVisible = false;
...@@ -69,6 +71,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -69,6 +71,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}) })
} }
deleteBgAudio() {
this.item.bgAudio = "";
this.item.bgAudioName = "";
this.save();
}
addquestion() { addquestion() {
this.item.questions.push({ this.item.questions.push({
options: [], options: [],
......
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