mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 00:59:18 +02:00
Add UID assignment on object creation
This commit is contained in:
@@ -13,7 +13,9 @@ entt::entity ECS::CreateObject()
|
||||
{
|
||||
const auto e = world_.create();
|
||||
world_.emplace<ECSComponent::Transform>(e);
|
||||
world_.emplace<ECSComponent::Identification>(e);
|
||||
// add UID
|
||||
auto id = world_.emplace<ECSComponent::Identification>(e);
|
||||
id.Id = nextId_++;
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user