Commit 151583a3 authored by yu's avatar yu

音频时长

parent 88329c28
import { onHomeworkFinish } from "../script/util";
import { defaultData } from "../script/defaultData";
import { itemData } from "./data";
import { hyLoader } from "./hyLoader";
import GameManager from "./gameManager";
import pg from "./pg";
import ani from "./ani";
import { asyncDelay, RandomInt, showFireworks } from "../script/utils";
import { onHomeworkFinish } from "../script/util_OP53";
import { defaultData } from "../script/defaultData_OP53";
import GameManager from "./gameManager_OP53";
import pg from "./pg_OP53";
import { asyncDelay, RandomInt, showFireworks } from "../script/utils_OP53";
cc.Class({
......@@ -732,13 +729,15 @@ cc.Class({
for (let i = 0; i < orderAudio.length; i++) {
let t = orderAudio[i];
await pg.audio.playAudioByUrl(t.audio, (id) => {
let time = cc.audioEngine.getDuration(id);
for (let j = 0; j < t.index.length; j++) {
if (t.index[j] && t.index[j] == 1) {
console.log("id: " + j + " i:" + i);
this.showCardAction(j, time);
setTimeout(() => {
let time = cc.audioEngine.getDuration(id);
for (let j = 0; j < t.index.length; j++) {
if (t.index[j] && t.index[j] == 1) {
console.log("id: " + j + " i:" + i);
this.showCardAction(j, time);
}
}
}
}, 60);
})
}
let layout_short = cc.find("card_group/layout_short", this.node);
......@@ -755,6 +754,7 @@ cc.Class({
let layout_short = cc.find("card_group/layout_short", this.node);
let layout_long = cc.find("card_group/layout_long", this.node);
let layout = this._stageData.word.length <= 5 ? layout_short : layout_long;
if (!time || time < 0) time = 0.4;
let t = time / 2;
if (t < 0.1) t += 0.2;
layout.children.forEach((item, idx) => {
......
......@@ -5,7 +5,7 @@
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import pg from "./pg";
import pg from "./pg_OP53";
cc.Class({
extends: cc.Component,
......
import pg from "./pg";
import pg from "./pg_OP53";
cc.Class({
extends: cc.Component,
......
......@@ -11,7 +11,7 @@
"height": 42,
"platformSettings": {},
"subMetas": {
"bg_lowerright": {
"bg_lowerright_OP53": {
"ver": "1.0.4",
"uuid": "19cd2e88-8eb3-4c89-ad4f-9c0753607833",
"rawTextureUuid": "7372b1ab-6c76-469b-b2f0-afb87fc044f9",
......
......@@ -11,7 +11,7 @@
"height": 134,
"platformSettings": {},
"subMetas": {
"bg_upperleft": {
"bg_upperleft_OP53": {
"ver": "1.0.4",
"uuid": "380d9fdd-740c-42ee-85cb-2478dc078b38",
"rawTextureUuid": "278c04a2-3596-49c1-b22d-9c6f5b6f9c60",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba1": {
"btn_laba1_OP53": {
"ver": "1.0.4",
"uuid": "690355f9-b03a-468b-9744-aecc70b45918",
"rawTextureUuid": "6bd79f55-497b-427e-96f2-56713d4a2a1d",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba2": {
"btn_laba2_OP53": {
"ver": "1.0.4",
"uuid": "a558bef0-afc5-4c10-a924-1a5e78cd2899",
"rawTextureUuid": "1ad4f056-cd8f-451c-a8cd-eb0ed005eb7b",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba3": {
"btn_laba3_OP53": {
"ver": "1.0.4",
"uuid": "44a8df36-2081-41b9-8c72-9c08a9497816",
"rawTextureUuid": "27f7fbb7-145b-4d04-a7e3-0794a457ec5b",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba": {
"btn_laba_OP53": {
"ver": "1.0.4",
"uuid": "bce01adf-e99f-4b43-8268-dbca5bc53356",
"rawTextureUuid": "daf0391f-6401-46a0-8791-756ab5ba1a9d",
......
......@@ -11,7 +11,7 @@
"height": 42,
"platformSettings": {},
"subMetas": {
"btn_replay": {
"btn_replay_OP53": {
"ver": "1.0.4",
"uuid": "53ca68e4-4348-4051-b9ba-a6d666a7e321",
"rawTextureUuid": "fbdc635d-e111-4a41-9c69-0a9bb1328cf3",
......
......@@ -11,7 +11,7 @@
"height": 252,
"platformSettings": {},
"subMetas": {
"bg_bian3": {
"bg_bian3_OP53": {
"ver": "1.0.4",
"uuid": "febdac0b-c1fb-4bd8-8746-dea5a1b31ac1",
"rawTextureUuid": "32bf1dc7-c4dc-43c3-bac4-33b1e89edcf9",
......
......@@ -11,7 +11,7 @@
"height": 252,
"platformSettings": {},
"subMetas": {
"bg_card3": {
"bg_card3_OP53": {
"ver": "1.0.4",
"uuid": "1792beb9-de57-45a7-affe-dd771ee093f1",
"rawTextureUuid": "6cf31f2e-31b9-4ffa-9473-67e9700ecdf0",
......
......@@ -11,7 +11,7 @@
"height": 342,
"platformSettings": {},
"subMetas": {
"bg_bian2": {
"bg_bian2_OP53": {
"ver": "1.0.4",
"uuid": "f7eaf067-f666-4f00-ac01-07395748b0f7",
"rawTextureUuid": "bafc3bbf-7d6f-498d-af6c-d64baaee2258",
......
......@@ -11,7 +11,7 @@
"height": 342,
"platformSettings": {},
"subMetas": {
"bg_card2": {
"bg_card2_OP53": {
"ver": "1.0.4",
"uuid": "498d5a09-da31-4b26-b866-609932c7b885",
"rawTextureUuid": "121bcf2c-ef4a-4ca0-9e63-ce0eee377e3f",
......
......@@ -11,7 +11,7 @@
"height": 304,
"platformSettings": {},
"subMetas": {
"bg_bian1": {
"bg_bian1_OP53": {
"ver": "1.0.4",
"uuid": "ef2a9352-5165-469c-bf68-e01dd12f7de1",
"rawTextureUuid": "eab3bc67-8d01-415f-8b7f-303f9d9e1b03",
......
......@@ -11,7 +11,7 @@
"height": 304,
"platformSettings": {},
"subMetas": {
"bg_card1": {
"bg_card1_OP53": {
"ver": "1.0.4",
"uuid": "62e9215f-8fc8-4b49-9a9e-4f5185127ac5",
"rawTextureUuid": "a4d287b2-f390-4601-addd-6bf8d7f4708b",
......
......@@ -11,7 +11,7 @@
"height": 275,
"platformSettings": {},
"subMetas": {
"icon_bigstar": {
"icon_bigstar_OP53": {
"ver": "1.0.4",
"uuid": "533bd0c6-52a7-4494-bab8-ce69fc6650ee",
"rawTextureUuid": "e10182a2-e669-49e7-abc7-b5cf11a97ae2",
......
......@@ -11,7 +11,7 @@
"height": 69,
"platformSettings": {},
"subMetas": {
"icon_star": {
"icon_star_OP53": {
"ver": "1.0.4",
"uuid": "de777091-6aa4-4e84-a590-1e7e1732f095",
"rawTextureUuid": "a0f470f8-986a-4268-8931-e6aa62699177",
......
......@@ -11,7 +11,7 @@
"height": 69,
"platformSettings": {},
"subMetas": {
"icon_stardi": {
"icon_stardi_OP53": {
"ver": "1.0.4",
"uuid": "a36dae46-2856-4b8a-be6d-1ff272ec5f49",
"rawTextureUuid": "e5d43d32-ce50-46d9-88d2-182faea98038",
......
......@@ -11,7 +11,7 @@
"height": 629,
"platformSettings": {},
"subMetas": {
"invalid_name_2": {
"invalid_name_2_OP53": {
"ver": "1.0.4",
"uuid": "818091e3-138a-4014-a260-8b5bf211e4e5",
"rawTextureUuid": "f3095929-f45b-4dc1-a4fb-30e0eb39029a",
......
......@@ -11,7 +11,7 @@
"height": 720,
"platformSettings": {},
"subMetas": {
"invalid_name": {
"invalid_name_OP53": {
"ver": "1.0.4",
"uuid": "5b5535b7-b673-47ed-84fc-c32e3ee05cdb",
"rawTextureUuid": "c2d39264-de81-4416-bb96-4cab8bdd25a0",
......
......@@ -11,7 +11,7 @@
"height": 76,
"platformSettings": {},
"subMetas": {
"title_bg": {
"title_bg_OP53": {
"ver": "1.0.4",
"uuid": "67ed9410-6b51-41ae-a067-51e529dfa80a",
"rawTextureUuid": "eaa7409b-fed3-447c-88a5-43b94aa08783",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"chose": {
"chose_OP53": {
"ver": "1.0.4",
"uuid": "6ac5d2e0-40d5-4f9a-9d6d-56aa9e567c91",
"rawTextureUuid": "06c4171e-e905-44c4-8bf6-f7c5583585db",
......
......@@ -11,7 +11,7 @@
"height": 68,
"platformSettings": {},
"subMetas": {
"combined_shape_3": {
"combined_shape_3_OP53": {
"ver": "1.0.4",
"uuid": "87dcad45-5c6c-461d-b8eb-88f432393d84",
"rawTextureUuid": "b2093045-843d-418d-b81d-dd8b1cf14fa1",
......
......@@ -11,7 +11,7 @@
"height": 68,
"platformSettings": {},
"subMetas": {
"combined_shape_4": {
"combined_shape_4_OP53": {
"ver": "1.0.4",
"uuid": "7b1794bc-f8d2-4551-9374-b4e1725647b8",
"rawTextureUuid": "888e78bf-f2ec-411c-b25b-283b4fcb59af",
......
......@@ -11,7 +11,7 @@
"height": 86,
"platformSettings": {},
"subMetas": {
"fail": {
"fail_OP53": {
"ver": "1.0.4",
"uuid": "29f6d6f8-df3b-4dcf-a3a8-6a830213b688",
"rawTextureUuid": "4b9758a9-905a-4816-b1c0-8baf81a39ea4",
......
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