Unify and streamline connecting to Resource changes
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include "shape_cast_2d.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/core_string_names.h"
|
||||
#include "scene/2d/collision_object_2d.h"
|
||||
#include "scene/2d/physics_body_2d.h"
|
||||
#include "scene/resources/circle_shape_2d.h"
|
||||
@@ -155,11 +154,11 @@ void ShapeCast2D::set_shape(const Ref<Shape2D> &p_shape) {
|
||||
return;
|
||||
}
|
||||
if (shape.is_valid()) {
|
||||
shape->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &ShapeCast2D::_shape_changed));
|
||||
shape->disconnect_changed(callable_mp(this, &ShapeCast2D::_shape_changed));
|
||||
}
|
||||
shape = p_shape;
|
||||
if (shape.is_valid()) {
|
||||
shape->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &ShapeCast2D::_shape_changed));
|
||||
shape->connect_changed(callable_mp(this, &ShapeCast2D::_shape_changed));
|
||||
shape_rid = shape->get_rid();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user