Commit a25a607d authored by yu's avatar yu

背景音乐

parent 9dfa4cab
......@@ -92,6 +92,12 @@
{
"__id__": 77
},
{
"__id__": 80
},
{
"__id__": 83
},
{
"__id__": 51
},
......@@ -99,19 +105,19 @@
"__id__": 56
},
{
"__id__": 89
"__id__": 95
}
],
"_active": true,
"_components": [
{
"__id__": 110
"__id__": 116
},
{
"__id__": 111
"__id__": 117
},
{
"__id__": 112
"__id__": 118
}
],
"_prefab": null,
......@@ -3684,26 +3690,274 @@
},
{
"__type__": "cc.Node",
"_name": "layout_start",
"_name": "jshx_bg_audio_off",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
"_children": [],
"_active": false,
"_components": [
{
"__id__": 78
},
{
"__id__": 80
"__id__": 79
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 96,
"height": 98
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-559,
-296,
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": "baK7RWDYNIdLmKfutULTlO"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6f4ea38d-9ee3-457e-9ede-696ccaaae2fd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1e+nlIGSJEw6UKQLaD1B7c"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 60,
"_right": 0,
"_top": 0,
"_bottom": 30,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "953QBZpR5Aw4VNceJ3/KXZ"
},
{
"__type__": "cc.Node",
"_name": "jshx_bg_audio_on",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 81
},
{
"__id__": 82
},
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 96,
"height": 98
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-559,
-296,
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": "3aXAWhU61Merqwg636/40Z"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 80
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d7fa09d2-66ee-4265-b5e0-39f747db6059"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "aa9+wocAZDB7ZEa5vFU/i2"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 80
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 60,
"_right": 0,
"_top": 0,
"_bottom": 30,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "f6zNNYzrtDg68EyTH4Gj9y"
},
{
"__type__": "cc.Node",
"_name": "layout_start",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 84
},
{
"__id__": 87
"__id__": 86
},
{
"__id__": 88
},
{
"__id__": 90
},
{
"__id__": 93
}
],
"_active": false,
......@@ -3761,13 +4015,13 @@
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 79
"__id__": 85
}
],
"_prefab": null,
......@@ -3823,7 +4077,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 84
},
"_enabled": true,
"_materials": [
......@@ -3855,13 +4109,13 @@
"_name": "bg_instructions",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 81
"__id__": 87
}
],
"_prefab": null,
......@@ -3917,7 +4171,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 80
"__id__": 86
},
"_enabled": true,
"_materials": [
......@@ -3949,13 +4203,13 @@
"_name": "desc",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 83
"__id__": 89
}
],
"_prefab": null,
......@@ -4011,7 +4265,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 82
"__id__": 88
},
"_enabled": true,
"_materials": [
......@@ -4046,16 +4300,16 @@
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 85
"__id__": 91
},
{
"__id__": 86
"__id__": 92
}
],
"_prefab": null,
......@@ -4111,7 +4365,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
"__id__": 90
},
"_enabled": true,
"_materials": [
......@@ -4143,7 +4397,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
"__id__": 90
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4204,7 +4458,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 84
"__id__": 90
},
"_id": "7095HuemhJQ40wHbz5jlAy"
},
......@@ -4213,13 +4467,13 @@
"_name": "touch",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 88
"__id__": 94
}
],
"_prefab": null,
......@@ -4275,7 +4529,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 93
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4347,19 +4601,19 @@
},
"_children": [
{
"__id__": 90
"__id__": 96
},
{
"__id__": 94
"__id__": 100
},
{
"__id__": 98
"__id__": 104
},
{
"__id__": 102
"__id__": 108
},
{
"__id__": 106
"__id__": 112
}
],
"_active": true,
......@@ -4417,11 +4671,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 89
"__id__": 95
},
"_children": [
{
"__id__": 91
"__id__": 97
}
],
"_active": true,
......@@ -4479,11 +4733,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 90
"__id__": 96
},
"_children": [
{
"__id__": 92
"__id__": 98
}
],
"_active": true,
......@@ -4541,13 +4795,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 91
"__id__": 97
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 93
"__id__": 99
}
],
"_prefab": null,
......@@ -4603,7 +4857,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
"__id__": 98
},
"_enabled": true,
"_materials": [
......@@ -4635,11 +4889,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 89
"__id__": 95
},
"_children": [
{
"__id__": 95
"__id__": 101
}
],
"_active": true,
......@@ -4697,11 +4951,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 94
"__id__": 100
},
"_children": [
{
"__id__": 96
"__id__": 102
}
],
"_active": true,
......@@ -4759,13 +5013,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 95
"__id__": 101
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 97
"__id__": 103
}
],
"_prefab": null,
......@@ -4821,7 +5075,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
"__id__": 102
},
"_enabled": true,
"_materials": [
......@@ -4853,11 +5107,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 89
"__id__": 95
},
"_children": [
{
"__id__": 99
"__id__": 105
}
],
"_active": true,
......@@ -4915,11 +5169,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 98
"__id__": 104
},
"_children": [
{
"__id__": 100
"__id__": 106
}
],
"_active": true,
......@@ -4977,13 +5231,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 99
"__id__": 105
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 101
"__id__": 107
}
],
"_prefab": null,
......@@ -5039,7 +5293,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 100
"__id__": 106
},
"_enabled": true,
"_materials": [
......@@ -5071,11 +5325,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 89
"__id__": 95
},
"_children": [
{
"__id__": 103
"__id__": 109
}
],
"_active": true,
......@@ -5133,11 +5387,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 102
"__id__": 108
},
"_children": [
{
"__id__": 104
"__id__": 110
}
],
"_active": true,
......@@ -5195,13 +5449,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 103
"__id__": 109
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 105
"__id__": 111
}
],
"_prefab": null,
......@@ -5257,7 +5511,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 104
"__id__": 110
},
"_enabled": true,
"_materials": [
......@@ -5289,11 +5543,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 89
"__id__": 95
},
"_children": [
{
"__id__": 107
"__id__": 113
}
],
"_active": true,
......@@ -5351,11 +5605,11 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 106
"__id__": 112
},
"_children": [
{
"__id__": 108
"__id__": 114
}
],
"_active": true,
......@@ -5413,13 +5667,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 107
"__id__": 113
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 109
"__id__": 115
}
],
"_prefab": null,
......@@ -5475,7 +5729,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 108
"__id__": 114
},
"_enabled": true,
"_materials": [
......@@ -5561,6 +5815,12 @@
"btn_laba": {
"__id__": 68
},
"btn_audio_off": {
"__id__": 77
},
"btn_audio_on": {
"__id__": 80
},
"_id": "5aci41ohNDvaH6JXqrDEGR"
}
]
\ No newline at end of file
import { asyncDelay, onHomeworkFinish, RandomInt } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Game, { FISH_OUT, GAME_STATE, Option } from "./tool/Game";
import pg from "./tool/pg";
import { asyncDelay, onHomeworkFinish, RandomInt } from "../script/util_extreme_skiing";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_extreme_skiing";
import Game, { FISH_OUT, GAME_STATE, Option } from "./tool/Game_extreme_skiing";
import pg from "./tool/pg_extreme_skiing";
const { ccclass, property } = cc._decorator;
......@@ -77,6 +77,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
layout_cannon: cc.Node = null;
@property(cc.Node)
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;
initData() {
......@@ -88,6 +92,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private layout_start: cc.Node;
private audioId: any;
private isPlayBgAudio: boolean;
async initView() {
cc.audioEngine.stopAllEffects();
this.layout_start = pg.view.find(this, "layout_start");
......@@ -106,15 +111,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
touch.on(cc.Node.EventType.TOUCH_END, () => {
cc.audioEngine.stopAllEffects();
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().title) {
cc.find("layout_info/bg_title/title", this.node).getComponent(cc.Label).string = Game.getIns().title;
}
if (Game.getIns().bgAudio || Game.getIns().bgAudio != "") {
this.btn_audio_on.active = true;
}
}
initEvent() {
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_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", () => {
this.gameStart();
......@@ -151,8 +164,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
onTouchStart() {
pg.audio.playLocalAudio(cc.find(`Canvas/res/audio/btn`));
pg.audio.playBgAudioByUrl(Game.getIns().bgAudio);
pg.event.emit("game_start");
}
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;
......@@ -178,11 +211,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
private intervalId;
private questionAudioId = -1;
private playLaba() {
let btn_kaba2 = this.btn_laba.getChildByName("btn_laba2");
let btn_kaba3 = this.btn_laba.getChildByName("btn_laba3");
btn_kaba2.active = true;
btn_kaba3.active = true;
if (this.questionAudioId > -1) pg.audio.stopAudio(this.questionAudioId);
let count = 0;
if (this.intervalId) clearInterval(this.intervalId);
......@@ -196,7 +231,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.audio.playAudioByUrl(Game.getIns().getCurrentPage().audio, (() => {
stop = true;
}))
})).then((audioId: number) => {
this.questionAudioId = audioId;
})
}
......@@ -274,3 +311,4 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
......@@ -5,8 +5,8 @@
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import Game, { GAME_STATE, Option } from "../tool/Game";
import pg from "../tool/pg";
import Game, { GAME_STATE, Option } from "../tool/Game_extreme_skiing";
import pg from "../tool/pg_extreme_skiing";
pg.event.clear();
const { ccclass, property } = cc._decorator;
......@@ -198,4 +198,4 @@ export default class layout_game extends cc.Component {
})
}
}
\ No newline at end of file
}
......@@ -145,11 +145,13 @@ export default class Game {
public question: { text, audio };
public title: string;
public questionText: string;
public bgAudio: string;
public init(data) {
this.singleGame = !data.onlineFlg;
this.question = { text: data.questionText, audio: data.questionTextAudio };
this.title = data.title;
this.questionText = data.questionText;
this.bgAudio = data.bgAduio || "";
this.start = false;
this.lists = [];
this.data = data.questions;
......@@ -209,4 +211,4 @@ export default class Game {
get isOver() {
return this.page > this.lists.length;
}
}
\ No newline at end of file
}
......@@ -532,7 +532,7 @@ let pg = {
});
},
stopAudio(audioId) {
if (!audioId) return;
if (audioId < 0) return;
cc.audioEngine.stopEffect(audioId);
},
playAudio(audioClip, cb = null) {
......@@ -555,6 +555,19 @@ let pg = {
});
})
},
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);
});
});
},
getAudioClip(audio_url) {
return new Promise((resolve, reject) => {
if (!audio_url) return resolve(null);
......@@ -589,4 +602,4 @@ let pg = {
},
event: Emitter.getInstance()
};
export default pg;
\ No newline at end of file
export default pg;
import { defaultData } from "../script/defaultData";
import { defaultData } from "../script/defaultData_extreme_skiing";
export class MyCocosSceneComponent extends cc.Component {
......@@ -176,4 +176,4 @@ export class MyCocosSceneComponent extends cc.Component {
cb && cb();
}
}
}
\ No newline at end of file
}
......@@ -2,6 +2,7 @@ export const defaultData = {
"title": "急速滑雪",
"questionText": "雪地里有许多不同的指示牌,运动员要选择哪一个呢?亲爱的小玩家,请你认真听游戏指令,帮助运动员选择正确的指示牌吧!游戏结束后,根据收集到的指示牌数量,你将获得相应的能量石奖励哟!开始挑战吧!",
"questionTextAudio": "https://staging-teach.cdn.ireadabc.com/c3b69ad3d51385eac7d4195773ef59f7_l.mp3",
"bgAduio": "https://staging-teach.cdn.ireadabc.com/ed84c18cc5f696ceaaf488ff98c228fe_l.mp3",
"questions": [
{
"options": [
......@@ -130,4 +131,4 @@ export const defaultData = {
// }
// ],
// "audioName": "极速滑雪 游戏说明.MP3"
// }
\ No newline at end of file
// }
......@@ -422,4 +422,4 @@ export function onHomeworkFinish(data) {
} else {
console.log('onHomeworkFinish');
}
}
\ No newline at end of file
}
......@@ -11,7 +11,7 @@
"height": 336,
"platformSettings": {},
"subMetas": {
"1orange": {
"1orange_extreme_skiing": {
"ver": "1.0.4",
"uuid": "17487daf-3875-48b5-9884-fb0a0bccd3d5",
"rawTextureUuid": "9eb89c84-1cc7-42c9-ac57-df702f77dcef",
......
......@@ -11,7 +11,7 @@
"height": 720,
"platformSettings": {},
"subMetas": {
"bg": {
"bg_extreme_skiing": {
"ver": "1.0.4",
"uuid": "057d9312-06e8-44d1-9379-6aafe1869ff0",
"rawTextureUuid": "f37041cd-c3f7-4b78-8f8e-3bce4538eda7",
......
......@@ -11,7 +11,7 @@
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_left": {
"btn_left_extreme_skiing": {
"ver": "1.0.4",
"uuid": "712039b7-4413-4fad-bc38-18899d62f771",
"rawTextureUuid": "af5ba431-34f8-4dd7-9275-364bf1e11142",
......
......@@ -11,7 +11,7 @@
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_right": {
"btn_right_extreme_skiing": {
"ver": "1.0.4",
"uuid": "0b0af429-d3cb-414c-ad5c-f984d5f82b72",
"rawTextureUuid": "39c9e77b-9a0e-4db2-81e4-7edd3affe3a1",
......
......@@ -11,7 +11,7 @@
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"icon_extreme_skiing": {
"ver": "1.0.4",
"uuid": "7ee60292-c82a-4606-a93f-6fdbe72fbb88",
"rawTextureUuid": "2f902c4b-aa5d-41e5-9da3-2b89cf1fd828",
......
......@@ -11,7 +11,7 @@
"height": 17,
"platformSettings": {},
"subMetas": {
"1": {
"1_extreme_skiing": {
"ver": "1.0.4",
"uuid": "87d63e6a-17a8-4ee2-b9f5-2fa9f0d744bc",
"rawTextureUuid": "dcec4956-8821-4e74-92be-bfb777427046",
......
......@@ -11,7 +11,7 @@
"height": 17,
"platformSettings": {},
"subMetas": {
"2": {
"2_extreme_skiing": {
"ver": "1.0.4",
"uuid": "aab1076f-cb07-452e-a50e-858fb0e940b0",
"rawTextureUuid": "c4121e31-6c35-4b3f-af6b-86425459cb32",
......
......@@ -11,7 +11,7 @@
"height": 17,
"platformSettings": {},
"subMetas": {
"3": {
"3_extreme_skiing": {
"ver": "1.0.4",
"uuid": "4b8ee07a-3d5f-48b4-aa9a-9432c370dde3",
"rawTextureUuid": "50f9482b-ed7d-4343-966a-b70f92fc8370",
......
......@@ -11,7 +11,7 @@
"height": 17,
"platformSettings": {},
"subMetas": {
"4": {
"4_extreme_skiing": {
"ver": "1.0.4",
"uuid": "eb09a891-e055-462a-ade6-c5e08dc6f24c",
"rawTextureUuid": "09170795-0987-40a9-9fee-be35a3f14c6c",
......
......@@ -11,7 +11,7 @@
"height": 17,
"platformSettings": {},
"subMetas": {
"5": {
"5_extreme_skiing": {
"ver": "1.0.4",
"uuid": "2c001aba-acde-4b94-8ada-3678f5b27d61",
"rawTextureUuid": "9101dbdf-2ed0-4a95-be32-0a6ad1fc967d",
......
......@@ -11,7 +11,7 @@
"height": 650,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"bg_bg_extreme_skiing": {
"ver": "1.0.4",
"uuid": "5306260e-cb0d-45fc-bc01-5a120b7c9f41",
"rawTextureUuid": "98ee8ae6-6604-442b-9f6a-ee946d9d54ff",
......
......@@ -11,7 +11,7 @@
"height": 343,
"platformSettings": {},
"subMetas": {
"bg_di": {
"bg_di_extreme_skiing": {
"ver": "1.0.4",
"uuid": "f1bb65df-5d0a-4417-8c70-e201c9339cad",
"rawTextureUuid": "602bd81d-300e-4881-9798-46384e2dc0c1",
......
......@@ -11,7 +11,7 @@
"height": 152,
"platformSettings": {},
"subMetas": {
"bg_ornament2": {
"bg_ornament2_extreme_skiing": {
"ver": "1.0.4",
"uuid": "343620f8-c718-4ea9-80c0-ab05695a45c4",
"rawTextureUuid": "5bc68731-8e0f-4bba-87d8-ecff0f934172",
......
......@@ -11,7 +11,7 @@
"height": 91,
"platformSettings": {},
"subMetas": {
"bg_ornament": {
"bg_ornament_extreme_skiing": {
"ver": "1.0.4",
"uuid": "6955191e-7015-47c2-970f-885835e01f6c",
"rawTextureUuid": "bc9e1f73-c77e-4489-a150-29e051166661",
......
......@@ -11,7 +11,7 @@
"height": 391,
"platformSettings": {},
"subMetas": {
"bg_people": {
"bg_people_extreme_skiing": {
"ver": "1.0.4",
"uuid": "c12ebc34-57fd-4f84-af02-916d60c8efda",
"rawTextureUuid": "c026bd36-aaeb-4cac-8f0a-71466567e613",
......
......@@ -11,7 +11,7 @@
"height": 212,
"platformSettings": {},
"subMetas": {
"bg_pic-di": {
"bg_picdi_extreme_skiing": {
"ver": "1.0.4",
"uuid": "2c15ee9a-5e11-432e-9ace-08a2b736c287",
"rawTextureUuid": "419d6c78-f55c-43b4-8019-c83d4b6a30e2",
......
......@@ -11,7 +11,7 @@
"height": 433,
"platformSettings": {},
"subMetas": {
"bg_sky": {
"bg_sky_extreme_skiing": {
"ver": "1.0.4",
"uuid": "4b66fb37-77c6-4376-ad2f-5da9505da166",
"rawTextureUuid": "9dad23f9-3101-4ec3-acde-735b1ea67bbc",
......
......@@ -11,7 +11,7 @@
"height": 111,
"platformSettings": {},
"subMetas": {
"bg_title": {
"bg_title_extreme_skiing": {
"ver": "1.0.4",
"uuid": "571a6beb-6750-45f3-a6c5-5202db7caa9f",
"rawTextureUuid": "9eecc6ae-709b-4084-be19-db2aa9a5f504",
......
......@@ -11,7 +11,7 @@
"height": 127,
"platformSettings": {},
"subMetas": {
"bg_word-di": {
"bg_worddi_extreme_skiing": {
"ver": "1.0.4",
"uuid": "a36258f8-eb2b-4b1e-bfc4-1f8490d7f2d6",
"rawTextureUuid": "a1ae450a-b7e3-4458-adac-cefe7419e8ac",
......
......@@ -11,7 +11,7 @@
"height": 98,
"platformSettings": {},
"subMetas": {
"btn_laba1": {
"btn_laba1_extreme_skiing": {
"ver": "1.0.4",
"uuid": "eabdadc9-5470-4705-8756-90657ccb6903",
"rawTextureUuid": "4366b8a2-b455-4f90-8371-2e488e9c4649",
......
......@@ -11,7 +11,7 @@
"height": 98,
"platformSettings": {},
"subMetas": {
"btn_laba2": {
"btn_laba2_extreme_skiing": {
"ver": "1.0.4",
"uuid": "d9abb489-aecf-4e5b-933c-d471dac36f69",
"rawTextureUuid": "fa42bae7-0c81-45e5-9dc1-d66035135bb4",
......
......@@ -11,7 +11,7 @@
"height": 98,
"platformSettings": {},
"subMetas": {
"btn_laba3": {
"btn_laba3_extreme_skiing": {
"ver": "1.0.4",
"uuid": "63941319-d6d4-47bd-95f2-04fbcf8e3a46",
"rawTextureUuid": "ce663e94-435a-41e5-84ac-f4cd665dafac",
......
......@@ -11,7 +11,7 @@
"height": 108,
"platformSettings": {},
"subMetas": {
"btn_restart": {
"btn_restart_extreme_skiing": {
"ver": "1.0.4",
"uuid": "0fdf75ec-9072-4931-8fef-a38a033af350",
"rawTextureUuid": "05db4773-827c-4876-a550-fb6da4b03a78",
......
......@@ -11,7 +11,7 @@
"height": 108,
"platformSettings": {},
"subMetas": {
"btn_start": {
"btn_start_extreme_skiing": {
"ver": "1.0.4",
"uuid": "1564f056-486a-45ae-b2a3-469780c40030",
"rawTextureUuid": "605d5fc5-57f3-4976-824a-8950c5abf936",
......
{
"ver": "2.3.5",
"uuid": "bb3258e5-a29f-44cd-9793-db49f291cbaf",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 96,
"height": 98,
"platformSettings": {},
"subMetas": {
"jshx_bg_audio_off_extreme_skiing": {
"ver": "1.0.4",
"uuid": "6f4ea38d-9ee3-457e-9ede-696ccaaae2fd",
"rawTextureUuid": "bb3258e5-a29f-44cd-9793-db49f291cbaf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 96,
"height": 98,
"rawWidth": 96,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c77b1e43-3428-4f4e-8264-42973a7f70b0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 96,
"height": 98,
"platformSettings": {},
"subMetas": {
"jshx_bg_audio_on_extreme_skiing": {
"ver": "1.0.4",
"uuid": "d7fa09d2-66ee-4265-b5e0-39f747db6059",
"rawTextureUuid": "c77b1e43-3428-4f4e-8264-42973a7f70b0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 96,
"height": 98,
"rawWidth": 96,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -66,12 +66,12 @@ export class ComponentBase {
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, key, it = this.item) {
onAudioUploadSuccess(e, key, it = this.item,audioName) {
let url = e.url;
let sp = url.split(".mp3");
let u = sp[0] + "_l.mp3";
it[key] = u;
it["audioName"] = e.name || "";
it[audioName] = e.name || "";
this.save();
}
......
......@@ -84,7 +84,7 @@
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.questionTextAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio')"></app-audio-recorder>
(audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio',item,'audioName')"></app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.audioName}}</span>
......@@ -92,6 +92,32 @@
</div>
</div>
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<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.bgAduio"
(audioUploaded)="onAudioUploadSuccess($event, 'bgAduio',item,'bgAduioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.bgAduioName}}</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 *ngFor="let question of item.questions; let i = index">
<div style="display: flex;margin-top: 20px;">
......@@ -106,7 +132,7 @@
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionAudio', question)">
(audioUploaded)="onAudioUploadSuccess($event, 'questionAudio', question,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
......@@ -170,7 +196,7 @@
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="option.audio"
(audioUploaded)="onAudioUploadSuccess($event, 'audio', option)">
(audioUploaded)="onAudioUploadSuccess($event, 'audio', option,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
......
......@@ -16,6 +16,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
questionText: "雪地里有许多不同的指示牌,运动员要选择哪一个呢?亲爱的小玩家,请你认真听游戏指令,帮助运动员选择正确的指示牌吧!游戏结束后,根据收集到的指示牌数量,你将获得相应的能量石奖励哟!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/c3b69ad3d51385eac7d4195773ef59f7_l.mp3",
questions: [],
bgAduio: "",
bgAduioName: "",
audioName: ""
};
......@@ -73,12 +75,18 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.item.questions.push({
options: [],
type: "",
questionAudio:"",
audioName:"",
questionAudio: "",
audioName: "",
});
this.save();
}
ngChange(i, j) {
this.save();
}
deleteBgAudio() {
this.item.bgAduio = "";
this.item.bgAduioName = "";
this.save();
}
}
\ No newline at end of file
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