fixed child armature display

This commit is contained in:
yinkaile
2018-01-08 15:51:55 +08:00
parent b059f1d4c9
commit aa41a196d0
3 changed files with 13 additions and 6 deletions
+10 -3
View File
@@ -55,7 +55,9 @@ dragonBones.CCFactory = cc.Class({
display = node.addComponent(dragonBones.ArmatureDisplay);
}
node.name = display.armatureName = armatureName;
node.name = armatureName;
display._armatureName = armatureName;
display._N$dragonAsset = comp.dragonAsset;
display._N$dragonAtlasAsset = comp.dragonAtlasAsset;
display._init();
@@ -66,8 +68,13 @@ dragonBones.CCFactory = cc.Class({
_buildChildArmature (dataPackage, slot, displayData) {
let temp = this._display;
let node = new cc.Node();
let display = this.createArmatureNode(temp, displayData.path);
let name = 'CHILD_ARMATURE-' + displayData.path;
let node = this._display.node.getChildByName(name);
if (!node) {
node = new cc.Node();
}
let display = this.createArmatureNode(temp, displayData.path, node);
node.name = name;
this._display = temp;
return display._armature;
+1 -1
View File
@@ -56,7 +56,7 @@ dragonBones.CCSlot = cc.Class({
_onUpdateDisplay () {
if (this._childArmature) {
this._childArmature._isChildArmature = true;
this._childArmature.display._isChildArmature = true;
}
},
@@ -52,7 +52,7 @@ let armatureAssembler = js.addon({
this.datas.length = 0;
let armature = comp._armature;
if (!armature || armature._isChildArmature) {
if (!armature || comp._isChildArmature) {
return this.datas;
}
@@ -94,7 +94,7 @@ let armatureAssembler = js.addon({
fillBuffers (batchData, vertexId, vbuf, uintbuf, ibuf) {
let comp = batchData.comp,
armature = batchData.comp._armature;
if (!armature || armature._isChildArmature) return;
if (!armature || comp._isChildArmature) return;
_vertexOffset = batchData.vertexOffset * comp._vertexFormat._bytes / 4;
_indiceOffset = batchData.indiceOffset;