Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

到底如何动态创建龙骨动画???

$
0
0

@zero870 写道:

cc.loader.loadResAll('db', function (err, assets) {
let node = new cc.Node('1213');
self.node.addChild( node, 99999 );
node.setPosition( cc.p( 200, 200 ) );
let armatureDisplay = node.addComponent(dragonBones.ArmatureDisplay);

for ( let i = 0; i < assets.length; i++ ) {
    if (assets[i] instanceof dragonBones.DragonBonesAsset) {
        armatureDisplay.dragonAsset = assets[i];
    }

    if (assets[i] instanceof dragonBones.DragonBonesAtlasAsset) {
        armatureDisplay.dragonAtlasAsset = assets[i];
    }
}
armatureDisplay.armatureName = 'mecha_1502b';
armatureDisplay.playAnimation('idle', -1);

});

这样根本不显示 cc.log(armatureDisplay.armature()); 都是null 就算显示这怎么操作动画? 到底怎么动态创建龙骨动画???

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>