龙骨ArmatureDisplay动态生成


龙骨ArmatureDisplay动态生成

1
2
3
4
5
6
7
8
9
// 清除旧的
this.node.removeComponent(this.m_armatureDisplay);
this.m_armatureDisplay.onDestroy();
// 动态生成
this.m_armatureDisplay = this.node.addComponent(dragonBones.ArmatureDisplay);
this.m_armatureDisplay.dragonAsset = dragonAsset;
this.m_armatureDisplay.dragonAtlasAsset = dragonAtlasAsset;
this.m_armatureDisplay.armatureName = armatureName;
this.m_armatureDisplay.playAnimation(animationName, 1);