mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fixed child armature display
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user