mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 08:07:17 +07:00
fix samples for new prefabs
This commit is contained in:
@@ -259,28 +259,6 @@ TEST_CASE("library"){
|
||||
REQUIRE(model_res->content().mesh()->content().indices_submesh_count() == 1);
|
||||
REQUIRE_FALSE(model_res->content().mesh()->content().indices(0).empty());
|
||||
}
|
||||
|
||||
{
|
||||
auto prefab_res = l.load_asset<prefab_asset>("prefab.json");
|
||||
REQUIRE(prefab_res);
|
||||
|
||||
ecs::registry w;
|
||||
ecs::entity e = w.create_entity(prefab_res->content().prototype());
|
||||
|
||||
REQUIRE(e.exists_component<touchable>());
|
||||
|
||||
REQUIRE(e.exists_component<rect_collider>());
|
||||
REQUIRE(e.get_component<rect_collider>().size() == v2f(1.f,2.f));
|
||||
REQUIRE(e.get_component<rect_collider>().offset() == v2f(2.f,4.f));
|
||||
|
||||
REQUIRE(e.exists_component<circle_collider>());
|
||||
REQUIRE(math::approximately(e.get_component<circle_collider>().radius(), 5.f));
|
||||
REQUIRE(e.get_component<circle_collider>().offset() == v2f(4.f,2.f));
|
||||
|
||||
REQUIRE(e.exists_component<polygon_collider>());
|
||||
REQUIRE(e.get_component<polygon_collider>().points() == vector<v2f>{{1,2},{2,3},{3,4}});
|
||||
REQUIRE(e.get_component<polygon_collider>().offset() == v2f(8.f,4.f));
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user