Commit 165901a1 authored by Tt's avatar Tt

back修改完成

parent d00d1152
{
"ver": "1.1.2",
"uuid": "19a64a93-34ed-4e65-9303-d0a268c1803c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "927f6c73-f3af-4c69-a990-9dc6668dbb70",
"subMetas": {}
}
\ No newline at end of file
// pg.event.emit('npc_layer_back_init',{ })
// pg.event.emit('npc_voice_play_voice_start') // pg.event.emit('npc_voice_play_voice_start')
// pg.event.emit('npc_voice_play_voice_end') // pg.event.emit('npc_voice_play_voice_end')
...@@ -14,25 +15,50 @@ export default class LayerBack extends cc.Component { ...@@ -14,25 +15,50 @@ export default class LayerBack extends cc.Component {
this.initView(); this.initView();
this.initEvent(); this.initEvent();
} }
private label_title: cc.Node;
initView() { initView() {
this.btn_back = pg.view.find(this, 'btn_back') this.btn_back = pg.view.find(this, 'btn_back')
this.img_npc_voice = pg.view.find(this, 'img_npc_voice') this.label_title = pg.view.find(this, 'label_title')
this.img_npc_voice = pg.view.find(this.label_title, 'img_npc_voice')
pg.view.touchOn(this.img_npc_voice, this.playVoiceStart, this);
}
private npcTitle: string;
private npcAudio: string;
updateView(data) {
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);
} }
initEvent() { initEvent() {
pg.view.touchOn(this.btn_back, this.onTouchBack, this) pg.view.touchOn(this.btn_back, this.onTouchBack, this)
pg.event.on('npc_layer_back_init', (data) => {
pg.event.on('npc_voice_play_voice_start', () => { this.updateView(data);
this.playVoiceStart(); if (!this.npcAudio) {
}) pg.event.emit('npc_voice_play_voice_end');
pg.event.on('npc_voice_play_voice_end', () => { } else {
this.playVoiceEnd(); this.playVoiceStart();
}
}) })
} }
private playVoiceCount: number; private playVoiceCount: number;
private audioId: number;
playVoiceStart() { playVoiceStart() {
if (this.playVoiceCount > 0) return; if (this.playVoiceCount > 0) {
if (this.audioId) cc.audioEngine.stopEffect(this.audioId);
this.playVoiceEnd();
}
this.playVoiceCount = 0; this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3) this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.playVoiceEnd();
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
});
} }
playVoiceRunning() { playVoiceRunning() {
this.playVoiceCount++; this.playVoiceCount++;
......
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 22
}, },
{ {
"__id__": 20 "__id__": 23
} }
], ],
"_prefab": { "_prefab": {
"__id__": 21 "__id__": 24
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 960,
0, 540,
0, 0,
0, 0,
0, 0,
...@@ -286,14 +286,14 @@ ...@@ -286,14 +286,14 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "61ulP3c3dDLb+4SfgnWK1F", "fileId": "61ulP3c3dDLb+4SfgnWK1F",
"sync": false "sync": false
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "img_npc_voice", "_name": "label_title",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1 "__id__": 1
...@@ -301,22 +301,90 @@ ...@@ -301,22 +301,90 @@
"_children": [ "_children": [
{ {
"__id__": 8 "__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 188,
"g": 132,
"b": 235,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150.74,
"height": 63
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-685.473,
441.1,
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.Node",
"_name": "img_npc_voice",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 9
}, },
{ {
"__id__": 11 "__id__": 12
}, },
{ {
"__id__": 14 "__id__": 15
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 18
} }
], ],
"_prefab": { "_prefab": {
"__id__": 18 "__id__": 19
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -328,8 +396,8 @@ ...@@ -328,8 +396,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 100,
"height": 0 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -340,8 +408,8 @@ ...@@ -340,8 +408,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-638.532, 208.95399999999995,
437.61, 0,
0, 0,
0, 0,
0, 0,
...@@ -370,17 +438,17 @@ ...@@ -370,17 +438,17 @@
"_name": "p1", "_name": "p1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 10
} }
], ],
"_prefab": { "_prefab": {
"__id__": 10 "__id__": 11
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -434,7 +502,7 @@ ...@@ -434,7 +502,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -467,9 +535,9 @@ ...@@ -467,9 +535,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "eeSSmA+sZKe4zFitN7jaL3", "fileId": "24sc3KKz1GwYD9fN1vST/m",
"sync": false "sync": false
}, },
{ {
...@@ -477,17 +545,17 @@ ...@@ -477,17 +545,17 @@
"_name": "p2", "_name": "p2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 13
} }
], ],
"_prefab": { "_prefab": {
"__id__": 13 "__id__": 14
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -541,7 +609,7 @@ ...@@ -541,7 +609,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -574,9 +642,9 @@ ...@@ -574,9 +642,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "29QTrf+y1JVa+D/t6K2NFr", "fileId": "3eNvEzM/JP56UZzdtTQAIN",
"sync": false "sync": false
}, },
{ {
...@@ -584,17 +652,17 @@ ...@@ -584,17 +652,17 @@
"_name": "p3", "_name": "p3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 15 "__id__": 16
} }
], ],
"_prefab": { "_prefab": {
"__id__": 16 "__id__": 17
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -648,7 +716,7 @@ ...@@ -648,7 +716,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 14 "__id__": 15
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -681,9 +749,9 @@ ...@@ -681,9 +749,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "4anvaDTjZFOb9U0HkCAMR2", "fileId": "72yribDepLjZha4CRHI/xf",
"sync": false "sync": false
}, },
{ {
...@@ -691,15 +759,15 @@ ...@@ -691,15 +759,15 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 7 "__id__": 8
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 9, "_alignFlags": 32,
"_left": 321.46799999999996, "_left": 0,
"_right": 0, "_right": -108.21399999999997,
"_top": 102.38999999999999, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -719,9 +787,55 @@ ...@@ -719,9 +787,55 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
},
"fileId": "e4KS5h7tdFiJnCxI3YJ5LQ",
"sync": false
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "I Spell",
"_N$string": "I Spell",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "927f6c73-f3af-4c69-a990-9dc6668dbb70"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "fft5aHS35DjoYobvKkISue", "fileId": "0aBC7NPVlMNKQpHcVkCq5H",
"sync": false "sync": false
}, },
{ {
...@@ -767,7 +881,7 @@ ...@@ -767,7 +881,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "", "fileId": "",
"sync": false "sync": false
......
{
"ver": "1.1.2",
"uuid": "508c4cc0-7802-495f-8c13-85a2a81c52cd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -33,6 +33,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -33,6 +33,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initView(); this.initView();
this.initListener(); this.initListener();
this.initGame(); this.initGame();
pg.event.on('npc_voice_play_voice_end', () => {
this.startGame();
})
pg.event.emit('npc_layer_back_init', this.data)
} }
_cantouch = null; _cantouch = null;
...@@ -93,7 +97,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -93,7 +97,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
let nextLayer = this.createLittleLayer(); let nextLayer = this.createLittleLayer();
this.updateLayer(nextLayer, this.NextData) this.updateLayer(nextLayer, this.NextData)
this.layers.push(nextLayer) this.layers.push(nextLayer)
}
startGame() {
this.startPlay(); this.startPlay();
} }
startPlay() { startPlay() {
......
...@@ -3,6 +3,8 @@ export const defaultData = ...@@ -3,6 +3,8 @@ export const defaultData =
"recordFlag": false, "recordFlag": false,
"title": "test", "title": "test",
"audio_url": '', "audio_url": '',
npcTitle: "I show info",
npcAudio: "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3",
"questionText": "", "questionText": "",
"questionTextAudio": "", "questionTextAudio": "",
"questions": [ "questions": [
......
...@@ -78,19 +78,18 @@ ...@@ -78,19 +78,18 @@
<div class="border-dashed" style="margin: 20px;width: 1000px;"> <div class="border-dashed" style="margin: 20px;width: 1000px;">
<span style="font-size: 20px;">标题: </span> <span style="font-size: 20px;">标题: </span>
<input type="text" nz-input [(ngModel)]="item.title" (blur)="save()"> <input type="text" nz-input [(ngModel)]="item.npcTitle" (blur)="save()">
<!-- <span style="font-size: 20px;">题目说明: </span> <span style="font-size: 20px;">npc音频: </span>
<input type="text" nz-input [(ngModel)]="item.questionText" (blur)="save()">
<span style="font-size: 20px;">题目说明音频: </span>
<div style="display:flex ;"> <div style="display:flex ;">
<div> <div>
<app-audio-recorder [audioUrl]="item.questionTextAudio" <app-audio-recorder [audioUrl]="item.npcAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'questionTextAudio',item,'audioName')"></app-audio-recorder> (audioUploaded)="onAudioUploadSuccess($event, 'npcAudio',item,'npcAudioName')">
</app-audio-recorder>
</div> </div>
<div style="margin: 5px"> <div style="margin: 5px">
<span>{{ item.audioName}}</span> <span>{{ item.npcAudioName}}</span>
</div> </div>
</div> --> </div>
</div> </div>
<div class="border-dashed" style="margin: 20px;width: 1000px;"> <div class="border-dashed" style="margin: 20px;width: 1000px;">
......
...@@ -13,7 +13,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -13,7 +13,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
item = { item = {
recordFlag: false, recordFlag: false,
title: "", npcTitle: "",
npcAudio: "",
npcAudioName: '',
questionText: "", questionText: "",
questionTextAudio: "", questionTextAudio: "",
questions: [{ questions: [{
...@@ -26,6 +28,13 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -26,6 +28,13 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
audioName: "" audioName: ""
}; };
init(): void {
if (!this.item.npcTitle) this.item.npcTitle = '';
if (!this.item.npcAudio) this.item.npcAudio = '';
if (!this.item.npcAudioName) this.item.npcAudioName = '';
console.log(new MetaFormCreator().create());
}
isVisible = false; isVisible = false;
deleteTitle = "是否删除题目"; deleteTitle = "是否删除题目";
deleteCallback = function () { }; deleteCallback = function () { };
...@@ -43,9 +52,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -43,9 +52,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
} }
init(): void {
console.log(new MetaFormCreator().create());
}
removeoption(i, j) { removeoption(i, j) {
this.openDelete("确定删除选项?", () => { this.openDelete("确定删除选项?", () => {
......
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