Merge pull request #357 from jareguo/master

minor fix
This commit is contained in:
Jare Guo
2016-02-22 11:21:45 +08:00
4 changed files with 10 additions and 7 deletions
+3
View File
@@ -776,6 +776,9 @@ var Node = cc.Class({
// attach to prefab
_Scene.PrefabUtils.linkPrefab(newPrefabRoot._prefab.asset, newPrefabRoot, this);
}
// conflict detection
_Scene.DetectConflict.afterAddChild(this);
}
},
+6 -2
View File
@@ -564,7 +564,9 @@ var Component = cc.Class({
callOnLostFocusInTryCatch(this);
}
}
_Scene.AssetsWatcher.start(this);
if ( !CC_TEST ) {
_Scene.AssetsWatcher.start(this);
}
}
if (this._enabled) {
@@ -604,7 +606,9 @@ var Component = cc.Class({
// onDestroy
if (CC_EDITOR) {
_Scene.AssetsWatcher.stop(this);
if ( !CC_TEST ) {
_Scene.AssetsWatcher.stop(this);
}
if (cc.engine._isPlaying || this.constructor._executeInEditMode) {
if (this.onDestroy) {
callOnDestroyInTryCatch(this);
+1 -1
View File
@@ -410,7 +410,7 @@ var Widget = cc.Class({
}
}
if (CC_EDITOR && !cc.engine._isPlaying) {
if (CC_EDITOR && !cc.engine._isPlaying && this.node._parent) {
// adjust the offsets to keep the size and position unchanged after alignment chagned
var type;
if (flag & TOP) {
-4
View File
@@ -147,10 +147,6 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{
oldParent._children.splice(removeAt, 1);
oldParent.emit(CHILD_REMOVED, this);
this._onHierarchyChanged(oldParent);
if (CC_EDITOR) {
_Scene.DetectConflict.afterAddChild(this);
}
}
}
else if (value) {