|
@@ -56,6 +56,26 @@ void BoxShape3D::_update_shape() {
|
|
|
Shape3D::_update_shape();
|
|
|
}
|
|
|
|
|
|
+#ifndef DISABLE_DEPRECATED
|
|
|
+bool BoxShape3D::_set(const StringName &p_name, const Variant &p_value) {
|
|
|
+ if (p_name == "extents") { // Compatibility with Godot 3.x.
|
|
|
+ // Convert to `size`, twice as big.
|
|
|
+ set_size((Vector3)p_value * 2);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool BoxShape3D::_get(const StringName &p_name, Variant &r_property) const {
|
|
|
+ if (p_name == "extents") { // Compatibility with Godot 3.x.
|
|
|
+ // Convert to `extents`, half as big.
|
|
|
+ r_property = size / 2;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+#endif // DISABLE_DEPRECATED
|
|
|
+
|
|
|
void BoxShape3D::set_size(const Vector3 &p_size) {
|
|
|
size = p_size;
|
|
|
_update_shape();
|