Commit 6e611ffc authored by liujiangnan's avatar liujiangnan

feat: 骨骼动画点击

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