Commit 29638ee1 authored by asdf's avatar asdf

骨骼播放第一个动画,背景音乐降低声音

parent 698cc0e8
......@@ -68,9 +68,9 @@ cc.Class({
var imageUrl = this.data.tex_png;
var skeUrl = this.data.ske_json;
var atlasUrl = this.data.tex_json;
// imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
// skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
// atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
cc.assetManager.loadAny([{ url: atlasUrl, ext: '.txt' }, { url: skeUrl, ext: '.txt' }], (error, assets) => {
if (error) {
console.log(error)
......@@ -92,8 +92,12 @@ cc.Class({
this.dragonBone.dragonAtlasAsset = atlas;
this.dragonBone.dragonAsset = asset;
this.dragonBone.armatureName = 'Armature';
let data = asset._dragonBonesJsonData.armature[0];
if(!data){
return;
}
this.dragonBone.armatureName = data.name;
this.animationName = data.animation[0].name;
}
});
}
......@@ -190,7 +194,7 @@ cc.Class({
this.stopSpine();
},
playSpine() {
this.dragonBone.playAnimation('normal', 1);
this.dragonBone.playAnimation(this.animationName, 1);
},
stopSpine() {
this.loadSpine();
......
......@@ -202,7 +202,7 @@ cc.Class({
return;
}
cc.assetManager.loadRemote(this.data.contentObj.bgm_url, null, (err, clip) => {
this.bgAudioId = cc.audioEngine.play(clip, true, 1);
this.bgAudioId = cc.audioEngine.play(clip, true, 0.5);
});
},
stopBgm() {
......
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