Commit 18950d67 authored by 智慧's avatar 智慧

feat:添加所有的龙骨模版节点

parent e492a15a
This diff is collapsed.
......@@ -6,7 +6,8 @@
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import {
asyncTweenTo
asyncTweenTo,
asyncPlayDragonBoneAnimation,
} from '../script/utils'
cc.Class({
......@@ -140,7 +141,6 @@ cc.Class({
initView() {
console.log('initView');
this.initBg();
this.initPic();
this.initBtn();
......@@ -161,21 +161,18 @@ cc.Class({
},
initBtn() {
const bg = cc.find('Canvas/bg');
console.log('bg', bg);
bg.addComponent(cc.Button);
//节点中添加了button组件 则可以添加click事件监听
bg.on('click', async () => {
console.log('hahaha');
await this.showDragon();
})
},
async showDragon() {
console.log('showDragon');
const dragonNode = cc.find('Canvas/DragonNode');
await asyncTweenTo(dragonNode, 0.5, { x: 0 });
const nodeName = 'Canvas/' + 'Greetings';
const animationNode = cc.find(nodeName);
await asyncTweenTo(animationNode, 0.5, { x: 0 });
},
// update (dt) {},
......
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