mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
refine camera
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user