diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-11-18 19:03:59 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-11-18 19:03:59 -0300 |
commit | 3c1fdedc9d0f957501439734b1c409c5773e9022 (patch) | |
tree | b9a547161279327876f8f03c96905b3e94fb3ff0 /tools | |
parent | 34a558ee8ddde967da38c5414e859491aa229152 (diff) | |
parent | ca7cfa9b4c5fbd487c9b5bcf9143cbfce35287e7 (diff) |
Merge pull request #2679 from eska014/set-all-tileset-shapes
Add all collision shapes to a tile when converting scenes to TileSets
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/plugins/tile_set_editor_plugin.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index 39b0ef3c75..09115472a8 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -110,11 +110,15 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me if (!child2->cast_to<StaticBody2D>()) continue; StaticBody2D *sb = child2->cast_to<StaticBody2D>(); - if (sb->get_shape_count()==0) + int shape_count = sb->get_shape_count(); + if (shape_count==0) continue; - Ref<Shape2D> collision=sb->get_shape(0); - if (collision.is_valid()) { - collisions.push_back(collision); + for (int shape_index=0; shape_index<shape_count; ++shape_index) + { + Ref<Shape2D> collision=sb->get_shape(shape_index); + if (collision.is_valid()) { + collisions.push_back(collision); + } } } |