diff --git a/extensions/spine/Skeleton.js b/extensions/spine/Skeleton.js index d230fb9d6e..1ac0360295 100644 --- a/extensions/spine/Skeleton.js +++ b/extensions/spine/Skeleton.js @@ -69,6 +69,34 @@ sp.Skeleton = cc.Class({ properties: { + /** + * !#en The skeletal animation is paused? + * !#zh 该骨骼动画是否暂停。 + * @property paused + * @type {Boolean} + * @readOnly + * @default false + */ + _paused: false, + paused: { + get: function () { + return this._paused; + }, + set: function (value) { + this._paused = value; + if (!this._sgNode) { + return; + } + if (value) { + this._sgNode.pause(); + } + else { + this._sgNode.resume(); + } + }, + visible: false + }, + /** * !#en * The skeleton data contains the skeleton information (bind pose bones, slots, draw order, @@ -352,6 +380,15 @@ sp.Skeleton = cc.Class({ _initSgNode: function () { var sgNode = this._sgNode; sgNode.setTimeScale(this.timeScale); + + var self = this; + sgNode.onEnter = function () { + _ccsg.Node.prototype.onEnter.call(this); + if (self._paused) { + this.pause(); + } + }; + //if (!CC_EDITOR) { // function animationCallback (ccObj, trackIndex, type, event, loopCount) { // var eventType = AnimEvents[type];3