diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-13 21:07:30 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-13 21:07:30 +0100 |
commit | c787eb6609d892537dfca9a46300bce7ef5e0fe2 (patch) | |
tree | 12bf93254a312fe08db7c9deb09abc3709ae02f3 /modules/csg/csg_shape.cpp | |
parent | 0668e0f5a9893f0cb46ab4e557a9e79e1e8e335c (diff) | |
parent | ac92704f395b70098771814686466681cee345c9 (diff) |
Merge pull request #66476 from GK-GreyGhost/csgbox-updater
Support CSGBox3D conversion of width/height/depth in 3 to size in 4
Diffstat (limited to 'modules/csg/csg_shape.cpp')
-rw-r--r-- | modules/csg/csg_shape.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 13c7a8202c..afb8e62eea 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -1255,6 +1255,30 @@ Vector3 CSGBox3D::get_size() const { return size; } +#ifndef DISABLE_DEPRECATED +// Kept for compatibility from 3.x to 4.0. +bool CSGBox3D::_set(const StringName &p_name, const Variant &p_value) { + if (p_name == "width") { + size.x = p_value; + _make_dirty(); + update_gizmos(); + return true; + } else if (p_name == "height") { + size.y = p_value; + _make_dirty(); + update_gizmos(); + return true; + } else if (p_name == "depth") { + size.z = p_value; + _make_dirty(); + update_gizmos(); + return true; + } else { + return false; + } +} +#endif + void CSGBox3D::set_material(const Ref<Material> &p_material) { material = p_material; _make_dirty(); |