refine camera

This commit is contained in:
2youyouo2
2017-03-27 12:00:50 +08:00
parent e1090e85e1
commit 5e94bc4a87
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -580,7 +580,7 @@ if (CC_DEV) {
//Physics: 8200
"8200": "Please set node\'s active instead of rigidbody\'s enabled.", //cc.RigidBody.enabled
//Camera: 8300
"8300": "Should only one camera be enabled, please check your project.", //cc.Camera.enabled
"8300": "Should only one camera exists, please check your project.", //cc.Camera.enabled
};
cc._LogInfos = logs;
}
+5 -1
View File
@@ -73,7 +73,7 @@ let Camera = cc.Class({
onEnable: function () {
if (Camera.main) {
cc.warnID('8300');
cc.errorID(8300);
return;
}
@@ -86,6 +86,10 @@ let Camera = cc.Class({
},
onDisable: function () {
if (Camera.main !== this) {
return;
}
Camera.main = null;
let targets = this._targets;