【美年达的开发日记】龙骨操作 - 显示隐藏骨骼及插槽

显示/隐藏 骨骼下的所有切片

function visibleBone(node:cc.Node, boneName:string, visible:boolean){
  let armatureDisplay = node.getComponent(dragonBones.ArmatureDisplay);
  let armature= armatureDisplay.armature();
  let bone= armature.getBone(boneName);
  bone.visible= visible;
}

显示/隐藏 插槽下的切片

function visibleSlot(node:cc.Node, slotName:string, visible:boolean){
  let armatureDisplay = node.getComponent(dragonBones.ArmatureDisplay);
  let armature= armatureDisplay.armature();
  let slot= armature.getSlot(slotName);
  slot.visible= visible;
}

没一个人评论,我给你捧个场吧!

大佬牛皮~能不能加个标记,1,2,3的,能有顺序的阅读