diff options
Diffstat (limited to 'editor/plugins/camera_3d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/camera_3d_editor_plugin.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/editor/plugins/camera_3d_editor_plugin.cpp b/editor/plugins/camera_3d_editor_plugin.cpp index 8bc1374269..48f9f208a5 100644 --- a/editor/plugins/camera_3d_editor_plugin.cpp +++ b/editor/plugins/camera_3d_editor_plugin.cpp @@ -33,7 +33,6 @@ #include "node_3d_editor_plugin.h" void Camera3DEditor::_node_removed(Node *p_node) { - if (p_node == node) { node = nullptr; Node3DEditor::get_singleton()->set_custom_camera(nullptr); @@ -42,7 +41,6 @@ void Camera3DEditor::_node_removed(Node *p_node) { } void Camera3DEditor::_pressed() { - Node *sn = (node && preview->is_pressed()) ? node : nullptr; Node3DEditor::get_singleton()->set_custom_camera(sn); } @@ -51,23 +49,21 @@ void Camera3DEditor::_bind_methods() { } void Camera3DEditor::edit(Node *p_camera) { - node = p_camera; if (!node) { preview->set_pressed(false); Node3DEditor::get_singleton()->set_custom_camera(nullptr); } else { - - if (preview->is_pressed()) + if (preview->is_pressed()) { Node3DEditor::get_singleton()->set_custom_camera(p_camera); - else + } else { Node3DEditor::get_singleton()->set_custom_camera(nullptr); + } } } Camera3DEditor::Camera3DEditor() { - preview = memnew(Button); add_child(preview); @@ -83,18 +79,15 @@ Camera3DEditor::Camera3DEditor() { } void Camera3DEditorPlugin::edit(Object *p_object) { - Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object)); //camera_editor->edit(Object::cast_to<Node>(p_object)); } bool Camera3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Camera3D"); } void Camera3DEditorPlugin::make_visible(bool p_visible) { - if (p_visible) { //Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object)); } else { @@ -103,7 +96,6 @@ void Camera3DEditorPlugin::make_visible(bool p_visible) { } Camera3DEditorPlugin::Camera3DEditorPlugin(EditorNode *p_node) { - editor = p_node; /* camera_editor = memnew( CameraEditor ); editor->get_viewport()->add_child(camera_editor); |