Commit 45c14333 authored by yu's avatar yu

1

parent 74a754b4
{
"ver": "1.1.2",
"uuid": "f1505731-1f3c-4667-aeb2-9de1e7982b51",
"uuid": "4e87018c-7280-4b8e-909d-cac26e0df675",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "8c9909a4-3e62-490f-868c-0bac3ff42e93",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "ecd349c0-ad88-4ef1-ace6-27e9ead1d200",
"subMetas": {}
}
\ No newline at end of file
{"name":"lypc","imagePath":"lypc_tex.png","SubTexture":[{"name":"7","x":1,"height":69,"y":1,"width":11},{"name":"6","x":14,"height":45,"y":1,"width":11},{"name":"5","x":40,"height":27,"y":1,"width":11},{"name":"4","x":1,"height":47,"y":72,"width":11},{"name":"3","x":27,"height":27,"y":1,"width":11},{"name":"2","x":14,"height":38,"y":48,"width":11},{"name":"1","x":14,"height":28,"y":88,"width":11}],"height":128,"width":64}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "bfff0b42-e9cc-4302-8ce3-5e421411d054",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "53bc8d78-30ec-4d2a-9d04-5b6f6d9f9699",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 128,
"platformSettings": {},
"subMetas": {
"lypc_tex": {
"ver": "1.0.4",
"uuid": "5bff2042-cef6-4236-9e63-4db54d4a3b07",
"rawTextureUuid": "53bc8d78-30ec-4d2a-9d04-5b6f6d9f9699",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -6,
"offsetY": 4,
"trimX": 1,
"trimY": 1,
"width": 50,
"height": 118,
"rawWidth": 64,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "35fbe4f1-249e-4263-90a1-de923c148363",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -52,3 +52,4 @@ export default class ImgVoice extends cc.Component {
}
}
......@@ -58,3 +58,4 @@ export default class LayerBack extends cc.Component {
}
}
import pg from "../../scene/tool/pg_hy02_paopao";
const { ccclass, property } = cc._decorator;
let win: any = window;
let courseware = win.courseware;
@ccclass
export default class LayerRecord extends cc.Component {
private layout_record: cc.Node;
onLoad() {
this.layout_record = pg.view.find(this, 'layout_record')
let AniNode = pg.view.find(this.layout_record, 'AniNode');
AniNode.active = false;
let btn_play = pg.view.find(this.layout_record, 'btn_play');
btn_play.active = false;
this.initEvent();
pg.event.emit('layer_record_setting', {
letter: 'test',
targetTime: 10
})
}
private letter: string;
private targetTime: number;
initEvent() {
pg.event.on('layer_record_setting', (data) => {
this.letter = data.letter
this.targetTime = data.targetTime
})
let btn_record = pg.view.find(this.layout_record, 'btn_record');
btn_record.on(cc.Node.EventType.TOUCH_START, this.onTouchRecord, this);
btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecordEnd, this);
}
showVoiceWhite() {
let voice_white = pg.view.find(this.layout_record, 'voice_white');
cc.tween(voice_white).set({ scale: 1, opacity: 255 }).to(1, { scale: 1.5, opacity: 0 }).delay(0.5).union().repeatForever().start();
}
private startTime: number;
showTimeStart() {
if (!this.targetTime) return;
let nowTime = new Date().getTime();
this.startTime = nowTime;
}
showTimeUpdate() {
if (!this.startTime) return;
let nowTime = new Date().getTime();
let subTime = (nowTime - this.startTime) / 1000;
let percent = 1 - (subTime / this.targetTime);
percent = Math.max(percent, 0)
let record_time = pg.view.find(this.layout_record, 'record_time');
record_time.getComponent(cc.Sprite).fillRange = percent;
if (percent == 0) {
this.showTimeEnd();
}
}
showTimeEnd() {
this.startTime = null;
let record_time = pg.view.find(this.layout_record, 'record_time');
record_time.getComponent(cc.Sprite).fillRange = 0;
}
protected update(dt: number): void {
this.showTimeUpdate();
}
//按钮触发,使用的方法
async onTouchRecord() {
let AniNode = pg.view.find(this.layout_record, 'AniNode');
AniNode.active = true;
this.showTimeStart();
cc.audioEngine.stopAllEffects();
courseware && courseware.startTest(this.letter); //开始录音
}
async onTouchRecordEnd() {
let AniNode = pg.view.find(this.layout_record, 'AniNode');
AniNode.active = false;
this.showTimeEnd();
let testData = {
"dtLastResponse": "2021-09-17 13:36:26:109",
"refText": "I haven't found anything out about him yet.",
"recordId": "6144295213f0a2200000ed93",
"eof": 1,
"result": {
"pronunciation": 25,
"resource_version": "3.1.0",
"fluency": 60,
"rhythm": 90,
"kernel_version": "5.2.4",
"overall": 25,//75
"integrity": 100,
"duration": "6.779",
"rear_tone": "fall",
"speed": 96,
},
"tokenId": "6144295408558b08dd000001",
"applicationId": "154838659000009e"
}
if (!courseware) return this.recrodEnd(testData)
courseware && courseware.stopTest((data) => {
data = JSON.parse(data);
this.recrodEnd(data);
}); //结束录音
}
async recrodEnd(data) {
let score = data.result.overall;
pg.event.emit('layer_record_score', score);
}
}
{
"ver": "1.0.8",
"uuid": "4d901cdd-437a-4627-bc0b-7297b145ad52",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -108,3 +108,4 @@ export default class LayerRight extends cc.Component {
}
}
{
"ver": "1.1.2",
"uuid": "57e8f830-a9d2-469d-b4a4-f08bee6181b8",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "dd5d53aa-0ec7-4476-a807-42f251d89b87",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"p0_hy02_paopao": {
"ver": "1.0.4",
"uuid": "c9eb055f-e3e0-4f6e-9e05-45d7c4608877",
"rawTextureUuid": "dd5d53aa-0ec7-4476-a807-42f251d89b87",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 23,
"trimY": 23,
"width": 104,
"height": 104,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "422dcc2c-0347-46ab-88d9-a167e71390ac",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"p1_hy02_paopao": {
"ver": "1.0.4",
"uuid": "84c11178-f263-4e14-aa51-104545bb5499",
"rawTextureUuid": "422dcc2c-0347-46ab-88d9-a167e71390ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 23,
"trimY": 23,
"width": 104,
"height": 104,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "27ef14bc-6d9a-4418-b9be-57fa7debf46f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"p2_hy02_paopao": {
"ver": "1.0.4",
"uuid": "79273752-abd4-4f1c-90d6-790e6a7d507c",
"rawTextureUuid": "27ef14bc-6d9a-4418-b9be-57fa7debf46f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 23,
"trimY": 23,
"width": 104,
"height": 104,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0a711ec1-92b8-4ff7-b0f5-feb00b6a2c24",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"p3_hy02_paopao": {
"ver": "1.0.4",
"uuid": "15171692-6cb7-462b-aca3-86891a8c425a",
"rawTextureUuid": "0a711ec1-92b8-4ff7-b0f5-feb00b6a2c24",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 23,
"trimY": 23,
"width": 104,
"height": 104,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9c3873f5-0f12-4520-afea-c0ed25db2900",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 162,
"height": 162,
"platformSettings": {},
"subMetas": {
"record_bg_hy02_paopao": {
"ver": "1.0.4",
"uuid": "9ca32a61-c62c-4a19-92f0-3108a36b6049",
"rawTextureUuid": "9c3873f5-0f12-4520-afea-c0ed25db2900",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 162,
"height": 162,
"rawWidth": 162,
"rawHeight": 162,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "41437958-b6ab-422b-9f58-8762b3975e11",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 140,
"height": 140,
"platformSettings": {},
"subMetas": {
"record_icon_hy02_paopao": {
"ver": "1.0.4",
"uuid": "2e3bd73f-da94-4921-be21-5acaaa12f138",
"rawTextureUuid": "41437958-b6ab-422b-9f58-8762b3975e11",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 140,
"height": 140,
"rawWidth": 140,
"rawHeight": 140,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a1813758-d06f-450c-b4e1-ecdea7d5668b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 131,
"height": 131,
"platformSettings": {},
"subMetas": {
"record_time_hy02_paopao": {
"ver": "1.0.4",
"uuid": "0907d9b3-c15d-444d-94cb-42a9523ca2d1",
"rawTextureUuid": "a1813758-d06f-450c-b4e1-ecdea7d5668b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 131,
"height": 131,
"rawWidth": 131,
"rawHeight": 131,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "de7b6722-7804-402d-93f0-1eb866a83834",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 184,
"height": 184,
"platformSettings": {},
"subMetas": {
"voice_white_hy02_paopao": {
"ver": "1.0.4",
"uuid": "4a26b10f-d021-4bad-ac0e-f513daa05ae5",
"rawTextureUuid": "de7b6722-7804-402d-93f0-1eb866a83834",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": 0,
"trimX": 12,
"trimY": 11,
"width": 162,
"height": 162,
"rawWidth": 184,
"rawHeight": 184,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -65,3 +65,4 @@ export default class Clund_06 extends cc.Component {
}
}
......@@ -56,3 +56,4 @@ export default class Clund_06 extends cc.Component {
}
}
This diff is collapsed.
......@@ -24,22 +24,7 @@ export function getDegree(p1, p2) {
let win: any = window;
let courseware = win.courseware;
enum GUN_STATE {
WAIT = 1,
SHUT_MIDDLE,
SHUT_LEFT,
SHUT_RIGHT
}
enum FISH_STATE {
NORMAL = 1,
BREAK,
FALL,
}
enum TIPS_STATE {
GOOD = 1,
TRY,
COM,
}
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
......@@ -82,6 +67,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
item: cc.Node = null;
@property(cc.Node)
item2: cc.Node = null;
@property(cc.Node)
layer_back: cc.Node = null;
@property(cc.Node)
layer_right: cc.Node = null;
......@@ -160,6 +149,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
let desc = cc.find("desc", top);
desc.getComponent(cc.Label).string = "" + question.text;
}
let img_voice = cc.find("img_voice", top);
if (question.audio == "") {
img_voice.active = false;
} else {
img_voice.active = true;
}
top.active = true;
top.parent = this.layout_topic;
this.layout_option.removeAllChildren();
......@@ -177,15 +174,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.tween(this.layout_topic).to(0.5, { y: this.topic }).start();
cc.tween(this.layout_option).to(0.5, { y: this.option }).call(() => { this.touch = true; }).start();
pg.event.emit("npc_voice_play_voice_start");
// pg.event.emit("npc_voice_play_voice_start");
pg.event.emit("img_voice_play_voice_start");
pg.audio.playAudioByUrl(question.audio).then(() => {
pg.event.emit("npc_voice_play_voice_end");
// pg.event.emit("npc_voice_play_voice_end");
pg.event.emit("img_voice_play_voice_end");
})
}
private onItem(e) {
if (!this.touch) return;
this.touch = false;
let target = e.target;
let data = target.data;
......@@ -255,7 +255,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
private checkRoundEnd() {
Game.getIns().addPage();
if (!Game.getIns().getCurrentPage()) {
this.gameOver();
pg.time.delayCall(1.2, () => {
this.layer_right.active = true;
pg.event.emit("layer_right_show_excellent");
this.gameOver();
});
} else {
this.playLocalAudio("next").then(() => {
this.showQuestion();
......@@ -346,3 +350,4 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
......@@ -239,3 +239,4 @@ export default class Game {
return this.page > this.lists.length;
}
}
......@@ -637,3 +637,4 @@ let pg = {
event: Emitter.getInstance()
};
export default pg;
......@@ -177,3 +177,4 @@ export class MyCocosSceneComponent extends cc.Component {
}
}
}
......@@ -68,3 +68,4 @@ export const defaultData = {
]
}
......@@ -423,3 +423,4 @@ export function onHomeworkFinish(data) {
console.log('onHomeworkFinish');
}
}
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