mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
Merge pull request #1145 from natural-law/dragonbones
Solve the reviewed issues.
This commit is contained in:
@@ -273,10 +273,6 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
this._factory = new dragonBones.CCFactory();
|
||||
},
|
||||
|
||||
onDestroy : function () {
|
||||
// TODO destroy the factory??
|
||||
},
|
||||
|
||||
__preload : function () {
|
||||
this._parseDragonAsset();
|
||||
this._parseDragonAtlasAsset();
|
||||
@@ -363,7 +359,7 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
// update inspector
|
||||
this._updateArmatureEnum();
|
||||
this._updateAnimEnum();
|
||||
this._refreshInspector();
|
||||
Editor.Utils.refreshSelectedInspector('node', this.node.uuid);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -387,26 +383,6 @@ dragonBones.ArmatureDisplay = cc.Class({
|
||||
setEnumAttr(this, '_defaultArmatureIndex', armatureEnum || DefaultArmaturesEnum);
|
||||
},
|
||||
|
||||
// force refresh inspector
|
||||
_refreshInspector: CC_EDITOR && function () {
|
||||
var ga = Editor.Selection.curGlobalActivate();
|
||||
var inspecting = (ga && ga.id === this.node.uuid && ga.type === 'node');
|
||||
if (inspecting) {
|
||||
Editor.Selection.unselect('node', this.node.uuid);
|
||||
ga = Editor.Selection.curGlobalActivate();
|
||||
var id = this.node.uuid;
|
||||
var inspectOther = (ga && ga.type === 'node' && ga.id);
|
||||
if (inspectOther) {
|
||||
setTimeout(function () {
|
||||
Editor.Selection.select('node', id, false);
|
||||
}, 200);
|
||||
}
|
||||
else {
|
||||
Editor.Selection.select('node', id, false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Play the specified animation.
|
||||
|
||||
@@ -27,9 +27,6 @@ var DragonBonesAsset = cc.Class({
|
||||
name: 'dragonBones.DragonBonesAsset',
|
||||
extends: cc.Asset,
|
||||
|
||||
ctor: function () {
|
||||
},
|
||||
|
||||
properties: {
|
||||
_dragonBonesJson : '',
|
||||
dragonBonesJson : {
|
||||
|
||||
@@ -51,9 +51,6 @@ var DragonBonesAtlasAsset = cc.Class({
|
||||
},
|
||||
},
|
||||
|
||||
ctor: function () {
|
||||
},
|
||||
|
||||
createNode: CC_EDITOR && function (callback) {
|
||||
var node = new cc.Node(this.name);
|
||||
var armatureDisplay = node.addComponent(dragonBones.ArmatureDisplay);
|
||||
|
||||
@@ -804,25 +804,6 @@ sp.Skeleton = cc.Class({
|
||||
// change enum
|
||||
setEnumAttr(this, '_defaultSkinIndex', skinEnum || DefaultSkinsEnum);
|
||||
},
|
||||
// force refresh inspector
|
||||
_refreshInspector: CC_EDITOR && function () {
|
||||
var ga = Editor.Selection.curGlobalActivate();
|
||||
var inspecting = (ga && ga.id === this.node.uuid && ga.type === 'node');
|
||||
if (inspecting) {
|
||||
Editor.Selection.unselect('node', this.node.uuid);
|
||||
ga = Editor.Selection.curGlobalActivate();
|
||||
var id = this.node.uuid;
|
||||
var inspectOther = (ga && ga.type === 'node' && ga.id);
|
||||
if (inspectOther) {
|
||||
setTimeout(function () {
|
||||
Editor.Selection.select('node', id, false);
|
||||
}, 200);
|
||||
}
|
||||
else {
|
||||
Editor.Selection.select('node', id, false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en Set the start event listener.
|
||||
@@ -923,7 +904,7 @@ sp.Skeleton = cc.Class({
|
||||
// update inspector
|
||||
self._updateAnimEnum();
|
||||
self._updateSkinEnum();
|
||||
self._refreshInspector();
|
||||
Editor.Utils.refreshSelectedInspector('node', this.node.uuid);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -189,5 +189,11 @@
|
||||
"entries": [
|
||||
"./cocos2d/core/graphics/index.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DragonBones",
|
||||
"entries": [
|
||||
"./extensions/dragonbones/index.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user