cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
this.scheduleOnce(function(){
this.myStart()
}, 1)
},
myStart () {
this._armatureDisPlay = this.getComponent(dragonBones.ArmatureDisplay)
this._armatureDisPlay.armatureName = 'robot'
//获取 Armatrue
this._armature = this._armatureDisPlay.armature()
//获取 animation
this._animations = this._armature.animation
var animations = this._animations._animationNames
// cc.log(animations)
// this._armatureDisPlay.playAnimation(animations[1], 1)
this._armature.animation.fadeIn(animations[2], 15, -1, 0, 'hit');//https://developer.egret.com/cn/apidoc/index/name/dragonBones.Animation
},
// update (dt) {
// },
// onDestroy () {
// },
});
https://gitee.com/xyyymz/creater_dragonBones_test/tree/master/