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

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

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