参考:
let factory = dragonBones.EgretFactory.factory; factory.parseDragonBonesData(RES.getRes("test_ske_dbbin")); factory.parseTextureAtlasData(RES.getRes("test_tex_json"), RES.getRes( "test_tex_png")); let armatureDisplay = factory.buildArmatureDisplay(name); this.addChild(this.armatureDisplay); //隐藏插槽 armatureDisplay.armature.getSlot("Sprite").displayIndex = -1; //显示插槽 armatureDisplay.armature.getSlot("Sprite").displayIndex = 0;
这个隐藏和显示,每次切换动画时,会自动重置displayIndex = 0,导致隐藏失效。
所以每次切动画都要重新设置一次...