Referencing Entity of same Type created at runTime in the System

I have created Entity of same Type in different system
And later want to access each entity in the same System which created the entity.Is there any way i can store the reference of the entity for later use.

Ex:- system1: ComponentSystem
{
CreateEntity();
AddmoveComponentOnEntity();
}
system2: ComponentSystem
{
CreateEntity();
AddmoveComponentOnEntity();
}
system3: ComponentSystem
{
CreateEntity();
AddmoveComponentOnEntity();
}

Now i want to access in each system the same entity created by that system which has the MoveComponent applied on it.
How is it possible?

The easiest way i see is that you also add a SharedComponentData with the name of the system when you create the entity.
Then just filter for that SharedComponent and you’ll get the entities that were create by such system.

2 Likes