Hi all
Currently I have a system which uses these two component groups.
squadGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(Navigate)),
ComponentType.ReadOnly(typeof(Squad)),
ComponentType.ReadOnly(typeof(Waypoint))
);
squaddieGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(Squaddie)),
ComponentType.ReadOnly(typeof(Position)),
typeof(Waypoint)
);
However, now I noticed that the system runs when either group has matching entities. I need it to only run when both groups match. So I’m using EntityArchetypeQueries, as follows:
squadQuery = new EntityArchetypeQuery
{
Any = Array.Empty<ComponentType>(),
None = Array.Empty<ComponentType>(),
All = new[]
{
ComponentType.ReadOnly(typeof(Navigate)),
ComponentType.ReadOnly(typeof(Squad)),
ComponentType.ReadOnly(typeof(Waypoint))
}
};
squaddieQuery = new EntityArchetypeQuery
{
Any = Array.Empty<ComponentType>(),
None = Array.Empty<ComponentType>(),
All = new[]
{
ComponentType.ReadOnly(typeof(Squaddie)),
ComponentType.ReadOnly(typeof(Position)),
typeof(Waypoint)
}
};
combined = GetComponentGroup(squadQuery, squaddieQuery);
But now I am wondering how I can select the results of either query. Is it possible to only get the matching entities from one EntityArchetypeQuery?
If not, is there a way to do so? Thanks! ![]()