Commit 2c76c908 authored by yu's avatar yu

音频时长

parent bbf62353
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_OP54";
import { defaultData } from "../script/defaultData_OP54";
import GameManager from "./gameManager_OP54";
import pg from "./pg_OP54";
import { asyncDelay, RandomInt, showFireworks } from "../script/utils_OP54";
cc.Class({
......@@ -750,13 +747,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);
......@@ -773,9 +772,10 @@ 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) => {
layout.children.forEach((item, idx) => {
if (idx != id) return;
cc.tween(item).by(t, { y: 20 }).by(t, { y: -20 }).start();
})
......
{
"ver": "1.0.8",
"uuid": "56a81a72-9fae-4ab6-9954-934fb2cad5e3",
"uuid": "c9cab6a1-ce65-47e5-b86c-f9aa4eb88629",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
......@@ -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_OP54";
cc.Class({
extends: cc.Component,
......
import pg from "./pg";
import pg from "./pg_OP54";
cc.Class({
extends: cc.Component,
......
......@@ -11,7 +11,7 @@
"height": 42,
"platformSettings": {},
"subMetas": {
"bg_lowerright": {
"bg_lowerright_OP54": {
"ver": "1.0.4",
"uuid": "29b37500-3c36-402b-87df-7fdc2051f790",
"rawTextureUuid": "04be2091-7249-4fcb-a65e-bfc2c3ecc96b",
......
......@@ -11,7 +11,7 @@
"height": 134,
"platformSettings": {},
"subMetas": {
"bg_upperleft": {
"bg_upperleft_OP54": {
"ver": "1.0.4",
"uuid": "3c0175c5-2b7a-4126-bbb8-0f5d11281fc2",
"rawTextureUuid": "3a02c5e9-45c7-4435-be30-c2af31be3de9",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba1": {
"btn_laba1_OP54": {
"ver": "1.0.4",
"uuid": "75904944-b4a7-4ba2-9aa5-0497e1551e50",
"rawTextureUuid": "051bfd31-ec34-48e0-a631-a11245509c14",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba2": {
"btn_laba2_OP54": {
"ver": "1.0.4",
"uuid": "5612cac7-1ce6-487c-b25a-42e05ed2e78a",
"rawTextureUuid": "36daaa39-08e0-4cd8-9f68-36108886aea1",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba3": {
"btn_laba3_OP54": {
"ver": "1.0.4",
"uuid": "a86c2d0f-9ee5-4cc0-8237-ae48d4169a41",
"rawTextureUuid": "461e8914-a1e8-4c83-a8f4-60aea22dd5e0",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"btn_laba": {
"btn_laba_OP54": {
"ver": "1.0.4",
"uuid": "2c7eeebc-c053-492e-a012-ea7213569315",
"rawTextureUuid": "d6fba06c-25ff-41cc-83a2-0cb8354ea244",
......
......@@ -11,7 +11,7 @@
"height": 42,
"platformSettings": {},
"subMetas": {
"btn_replay": {
"btn_replay_OP54": {
"ver": "1.0.4",
"uuid": "30d458b1-dc30-4f78-909a-2013739fb431",
"rawTextureUuid": "5d8d8e3b-377b-4ac1-9e3a-ef2fb85baa17",
......
......@@ -11,7 +11,7 @@
"height": 252,
"platformSettings": {},
"subMetas": {
"bg_bian3": {
"bg_bian3_OP54": {
"ver": "1.0.4",
"uuid": "e6db9f06-74c0-4ae4-887d-64837fd242f0",
"rawTextureUuid": "9a587b06-cf32-4d48-a541-6ada3ad274e4",
......
......@@ -11,7 +11,7 @@
"height": 252,
"platformSettings": {},
"subMetas": {
"bg_card3": {
"bg_card3_OP54": {
"ver": "1.0.4",
"uuid": "77c7f91a-4edd-4977-9ec5-c26b341005a7",
"rawTextureUuid": "3cc45ca8-434e-4600-90ba-56b9a2760fd6",
......
......@@ -11,7 +11,7 @@
"height": 342,
"platformSettings": {},
"subMetas": {
"bg_bian2": {
"bg_bian2_OP54": {
"ver": "1.0.4",
"uuid": "d6cce320-5f9e-489c-a472-a9365e7d24b6",
"rawTextureUuid": "811f7d25-d89a-44a2-9d51-b46f5f5249cb",
......
......@@ -11,7 +11,7 @@
"height": 342,
"platformSettings": {},
"subMetas": {
"bg_card2": {
"bg_card2_OP54": {
"ver": "1.0.4",
"uuid": "257625f4-9a61-42fb-8422-1f0b05e376f0",
"rawTextureUuid": "2e392a4b-6991-4ff9-a669-5c9b127df2f1",
......
......@@ -11,7 +11,7 @@
"height": 304,
"platformSettings": {},
"subMetas": {
"bg_bian1": {
"bg_bian1_OP54": {
"ver": "1.0.4",
"uuid": "c66d52bb-5d83-4c9a-b93e-abcadc126dd8",
"rawTextureUuid": "f9f52fd3-fcec-40fe-99a5-f48100c8f9d1",
......
......@@ -11,7 +11,7 @@
"height": 304,
"platformSettings": {},
"subMetas": {
"bg_card1": {
"bg_card1_OP54": {
"ver": "1.0.4",
"uuid": "1a4f36a9-6013-47ac-9f82-24b670c459b9",
"rawTextureUuid": "80fd26f4-7566-4bc9-96e7-f1e752256024",
......
......@@ -11,7 +11,7 @@
"height": 275,
"platformSettings": {},
"subMetas": {
"icon_bigstar": {
"icon_bigstar_OP54": {
"ver": "1.0.4",
"uuid": "b605e3ec-c73b-4f18-8658-1297286390b6",
"rawTextureUuid": "58f797a6-d197-4c41-a806-b2dcbcdf4281",
......
......@@ -11,7 +11,7 @@
"height": 69,
"platformSettings": {},
"subMetas": {
"icon_star": {
"icon_star_OP54": {
"ver": "1.0.4",
"uuid": "7b444d01-27cb-46a2-b383-f897f9c2e5a6",
"rawTextureUuid": "97bfb9c6-d3dc-4c16-b97f-3fe30c06dbf7",
......
......@@ -11,7 +11,7 @@
"height": 69,
"platformSettings": {},
"subMetas": {
"icon_stardi": {
"icon_stardi_OP54": {
"ver": "1.0.4",
"uuid": "6eb027e3-4628-4a98-99b0-3977f187254d",
"rawTextureUuid": "b5dc32ee-1aed-49e4-a4a2-b7545dbc5738",
......
......@@ -11,7 +11,7 @@
"height": 629,
"platformSettings": {},
"subMetas": {
"invalid_name_2": {
"invalid_name_2_OP54": {
"ver": "1.0.4",
"uuid": "dfaabebe-a706-4ea6-ad4a-6be4152236e6",
"rawTextureUuid": "60927e11-4a7b-47a1-975e-9dac1f33d2d0",
......
......@@ -11,7 +11,7 @@
"height": 720,
"platformSettings": {},
"subMetas": {
"invalid_name": {
"invalid_name_OP54": {
"ver": "1.0.4",
"uuid": "4c0abb83-4c66-45cc-af40-4c1e87804615",
"rawTextureUuid": "499b9a09-2590-4e82-9f8a-d05f5d7e173f",
......
......@@ -11,7 +11,7 @@
"height": 76,
"platformSettings": {},
"subMetas": {
"title_bg": {
"title_bg_OP54": {
"ver": "1.0.4",
"uuid": "a23a27e9-93c7-40f5-b990-970eb7461386",
"rawTextureUuid": "c520da64-ba31-4144-a89c-dd1375a6546f",
......
......@@ -11,7 +11,7 @@
"height": 80,
"platformSettings": {},
"subMetas": {
"chose": {
"chose_OP54": {
"ver": "1.0.4",
"uuid": "ffcc7049-c012-41b4-a1a0-95f2126e4c0e",
"rawTextureUuid": "8ddcb48a-953f-4953-a724-6a68c683e8a7",
......
......@@ -11,7 +11,7 @@
"height": 68,
"platformSettings": {},
"subMetas": {
"combined_shape_3": {
"combined_shape_3_OP54": {
"ver": "1.0.4",
"uuid": "a7a6c002-01a7-4105-8cbb-98d89c69c483",
"rawTextureUuid": "a54aaa8a-6cc3-4ebe-a3fa-adbcd1a26ea2",
......
......@@ -11,7 +11,7 @@
"height": 68,
"platformSettings": {},
"subMetas": {
"combined_shape_4": {
"combined_shape_4_OP54": {
"ver": "1.0.4",
"uuid": "6460afbf-8cb2-4c70-95cf-7984eb6eb994",
"rawTextureUuid": "9738c999-f1d3-4967-8c37-9582aceb0561",
......
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