Merge pull request #1069 from jareguo/v1.2

fix asset-watcher
This commit is contained in:
Wang Nan
2016-09-02 09:39:42 +08:00
committed by GitHub
2 changed files with 14 additions and 6 deletions
+4 -3
View File
@@ -236,9 +236,10 @@ var Component = cc.Class({
name: 'cc.Component',
extends: cc.Object,
ctor: (CC_EDITOR && window._Scene && _Scene.AssetsWatcher) ? function () {
_Scene.AssetsWatcher.initComponent(this);
ctor: CC_EDITOR ? function () {
if (window._Scene && _Scene.AssetsWatcher) {
_Scene.AssetsWatcher.initComponent(this);
}
// Support for Scheduler
this.__instanceId = cc.ClassManager.getNewInstanceId();
} : function () {
+10 -3
View File
@@ -163,10 +163,17 @@ var Sprite = cc.Class({
return this._spriteFrame;
},
set: function (value, force) {
if (this._spriteFrame === value) {
return;
}
var lastSprite = this._spriteFrame;
if (CC_EDITOR) {
if (!force && ((lastSprite && lastSprite._uuid) === (value && value._uuid))) {
return;
}
}
else {
if (lastSprite === value) {
return;
}
}
this._spriteFrame = value;
this._applySpriteFrame(lastSprite);
if (CC_EDITOR) {