Commit 6e611ffc authored by liujiangnan's avatar liujiangnan

feat: 骨骼动画点击

parent ef637b79
...@@ -149,6 +149,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -149,6 +149,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
const animaNode = btnStart['animaNode']; const animaNode = btnStart['animaNode'];
animaNode.addComponent(cc.Button);
const db = animaNode.getComponent(dragonBones.ArmatureDisplay); const db = animaNode.getComponent(dragonBones.ArmatureDisplay);
let anis = db.getAnimationNames("armatureName"); let anis = db.getAnimationNames("armatureName");
db.playAnimation(anis[0], 0); db.playAnimation(anis[0], 0);
...@@ -193,14 +194,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -193,14 +194,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
const btnStart = cc.find("btn_start", this.node); const btnStart = cc.find("btn_start", this.node);
btnStart.on('click', () => { const start_ske = btnStart['animaNode'];
if (btnStart['cantClick']) { start_ske.on('click', () => {
if (start_ske['cantClick']) {
return; return;
} }
btnStart['cantClick'] = true; start_ske['cantClick'] = true;
this.startNode.active = true; this.startNode.active = true;
let start_ske = btnStart['animaNode'];
cc.tween(start_ske).to(0.2, { scale: 1 }).start(); cc.tween(start_ske).to(0.2, { scale: 1 }).start();
this.updataTipArrow(); this.updataTipArrow();
}); });
...@@ -210,7 +211,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -210,7 +211,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
const btnStart = cc.find("btn_start", this.node); const btnStart = cc.find("btn_start", this.node);
let start_ske = btnStart['animaNode']; let start_ske = btnStart['animaNode'];
cc.tween(start_ske).to(0.2, { scale: 0.3 }).call(() => { cc.tween(start_ske).to(0.2, { scale: 0.3 }).call(() => {
cc.find("btn_start", this.node)['cantClick'] = false; start_ske['cantClick'] = false;
}).start(); }).start();
this.page_view.getComponent(cc.PageView).setCurrentPageIndex(0); this.page_view.getComponent(cc.PageView).setCurrentPageIndex(0);
this.startNode.active = false; this.startNode.active = false;
......
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