This commit is contained in:
parent
5614902611
commit
dd892a327d
2 changed files with 8 additions and 4 deletions
|
@ -191,11 +191,12 @@ void Camera::_update_camera() {
|
|||
get_viewport()->_camera_transform_changed_notify();
|
||||
*/
|
||||
|
||||
if (is_inside_tree() && is_current()) {
|
||||
get_viewport()->_camera_transform_changed_notify();
|
||||
}
|
||||
if (!is_inside_tree() || get_tree()->is_node_being_edited(this) || !is_current())
|
||||
return;
|
||||
|
||||
if (is_current() && get_world().is_valid()) {
|
||||
get_viewport()->_camera_transform_changed_notify();
|
||||
|
||||
if (get_world().is_valid()) {
|
||||
get_world()->_update_camera(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -936,6 +936,9 @@ void Viewport::_camera_remove(Camera *p_camera) {
|
|||
|
||||
cameras.erase(p_camera);
|
||||
if (camera == p_camera) {
|
||||
if (camera && find_world().is_valid()) {
|
||||
camera->notification(Camera::NOTIFICATION_LOST_CURRENT);
|
||||
}
|
||||
camera = NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue