Commit 1eb7a073 authored by 智慧's avatar 智慧

feat:龙骨播放完添加声音

parent 41731e61
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "2f34dee5-2c2b-4d47-ace6-6cc2c203ec5a",
"downloadMode": 0,
"duration": 0.130612,
"duration": 1.515125,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "30ac90c2-479b-4a20-a585-9c26b51cc014",
"downloadMode": 0,
"duration": 1.802438,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f12477dc-ae26-41fd-bc03-da4f7d30d875",
"downloadMode": 0,
"duration": 1.54125,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f1f3fdb4-169e-4713-ac2c-3914c3f3d7a2",
"downloadMode": 0,
"duration": 1.410625,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "04befefd-db43-4f4c-a718-70b02696e93e",
"downloadMode": 0,
"duration": 1.828563,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "624fabbd-fff6-47f2-8e2a-90be08333be7",
"downloadMode": 0,
"duration": 2.2465,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "d2df761e-e07b-4ee9-80d4-b0bb6fae10b5",
"downloadMode": 0,
"duration": 0.862063,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "06b4cf42-6a68-41be-bbf7-8998792cbb49",
"downloadMode": 0,
"duration": 1.3845,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "d9d2bbdb-e016-4c79-8e91-beadaa351bd0",
"downloadMode": 0,
"duration": 1.489,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "e8a55aa6-f18d-467c-b5d6-01cc6b9fc8dd",
"downloadMode": 0,
"duration": 1.43675,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "9ea13603-3efc-4157-bf74-1cc5af934679",
"downloadMode": 0,
"duration": 0.9665,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "da98e191-78f7-4e22-aec6-ef4b4c26ee57",
"downloadMode": 0,
"duration": 0.9665,
"subMetas": {}
}
\ No newline at end of file
......@@ -112,18 +112,21 @@
},
{
"__id__": 38
},
{
"__id__": 40
}
],
"_active": true,
"_components": [
{
"__id__": 40
"__id__": 42
},
{
"__id__": 41
"__id__": 43
},
{
"__id__": 42
"__id__": 44
}
],
"_prefab": null,
......@@ -213,7 +216,7 @@
"array": [
0,
0,
476.30044043450715,
476.35456702224366,
0,
0,
0,
......@@ -1977,6 +1980,115 @@
"_N$enableBatch": false,
"_id": "28FHURE+pOSrJCilMbAlRG"
},
{
"__type__": "cc.Node",
"_name": "MusicNode",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 41
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "2cgjcbPcxPJJQTnlHEJwSG"
},
{
"__type__": "473db1GpY9LxIzR5nmaB8K8",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
},
"_enabled": true,
"DailyConversations": {
"__uuid__": "2f34dee5-2c2b-4d47-ace6-6cc2c203ec5a"
},
"ExerciseTime": {
"__uuid__": "30ac90c2-479b-4a20-a585-9c26b51cc014"
},
"TraceWithMe": null,
"LetsBlend": {
"__uuid__": "f12477dc-ae26-41fd-bc03-da4f7d30d875"
},
"LetsReview": {
"__uuid__": "f1f3fdb4-169e-4713-ac2c-3914c3f3d7a2"
},
"LettersInLife": {
"__uuid__": "04befefd-db43-4f4c-a718-70b02696e93e"
},
"LookAndSay": {
"__uuid__": "624fabbd-fff6-47f2-8e2a-90be08333be7"
},
"Phonics": {
"__uuid__": "d2df761e-e07b-4ee9-80d4-b0bb6fae10b5"
},
"ReadClosely": {
"__uuid__": "06b4cf42-6a68-41be-bbf7-8998792cbb49"
},
"SightWords": {
"__uuid__": "d9d2bbdb-e016-4c79-8e91-beadaa351bd0"
},
"StoryTime": {
"__uuid__": "e8a55aa6-f18d-467c-b5d6-01cc6b9fc8dd"
},
"Topic": {
"__uuid__": "9ea13603-3efc-4157-bf74-1cc5af934679"
},
"WarmUp": {
"__uuid__": "da98e191-78f7-4e22-aec6-ef4b4c26ee57"
},
"_id": "3bdR15TnZJlqXE8PPz9+r4"
},
{
"__type__": "cc.Canvas",
"_name": "",
......
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
DailyConversations: {
default: null,
type: cc.AudioClip
},
ExerciseTime: {
default: null,
type: cc.AudioClip
},
TraceWithMe: {
default: null,
type: cc.AudioClip
},
LetsBlend: {
default: null,
type: cc.AudioClip
},
LetsReview: {
default: null,
type: cc.AudioClip
},
LettersInLife: {
default: null,
type: cc.AudioClip
},
LookAndSay: {
default: null,
type: cc.AudioClip
},
Phonics: {
default: null,
type: cc.AudioClip
},
ReadClosely: {
default: null,
type: cc.AudioClip
},
SightWords: {
default: null,
type: cc.AudioClip
},
StoryTime: {
default: null,
type: cc.AudioClip
},
Topic: {
default: null,
type: cc.AudioClip
},
WarmUp: {
default: null,
type: cc.AudioClip
},
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
},
// update (dt) {},
playEffect(name, loop = false, volume = 1) {
cc.audioEngine.play(this[name], loop, volume);
}
});
{
"ver": "1.0.8",
"uuid": "473dbd46-a58f-4bc4-8cd1-e6799a07c2bc",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@
import {
asyncTweenTo,
asyncPlayDragonBoneAnimation,
asyncDelay,
} from '../script/utils'
cc.Class({
......@@ -84,7 +85,7 @@ cc.Class({
getDefaultData() {
const dataJson = '{"animationName":"DailyConversations"}'
// const dataJson = '{"animationName":"DailyConversations"}'
// const dataJson = '{"animationName":"WarmUp"}'
// const dataJson = '{"animationName":"LettersInLife"}'
// const dataJson = '{"animationName":"Phonics"}'
......@@ -96,7 +97,7 @@ cc.Class({
// const dataJson = '{"animationName":"SightWords"}'
// const dataJson = '{"animationName":"StoryTime"}'
// const dataJson = '{"animationName":"Topic"}'
// const dataJson = '{"animationName":"ReadClosely"}'
const dataJson = '{"animationName":"ReadClosely"}'
const data = JSON.parse(dataJson);
return data;
},
......@@ -125,7 +126,6 @@ cc.Class({
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
console.log('呵呵呵');
this.loadEnd();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
......@@ -183,6 +183,9 @@ cc.Class({
var dragonDisplay = animationNode.getComponent(dragonBones.ArmatureDisplay);
var animNameArr = dragonDisplay.getAnimationNames("armatureName");
dragonDisplay.playAnimation(animNameArr[0], 1);
dragonDisplay.once(dragonBones.EventObject.COMPLETE, () => {
this.playEffect(this.data.animationName);
});
animationNode.x = cc.find('Canvas').width;
animationNode.y = 0;
......@@ -257,5 +260,9 @@ cc.Class({
},
// ------------------------------------------
playEffect(name, loop, volume) {
let musicComponent = cc.find('Canvas/MusicNode').getComponent('Music');
musicComponent.playEffect(name, loop, volume);
}
});
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