Quick question , is there any alternatives to aspect recommended by the community ?
Like an aspect like this one :
public readonly partial struct ComplexAspect : IAspect {
public readonly RefRO<ComponentA> ComponentA;
public readonly RefRW<ComponentB> ComponentB;
public readonly RefRW<ComponentC> ComponentC;
public readonly RefRW<ComponentD> ComponentD;
public readonly RefRW<ComponentE> ComponentE;
public readonly RefRW<ComponentF> ComponentF;
public readonly RefRW<ComponentG> ComponentG;
public readonly Entity Self;
}
foreach (ComplexAspect aspect in SystemAPI.Query<ComplexAspect >()){
// do something with ComplexAspect
}
I could use :
public static EntityQueryBuilder AspectQuery =>
new EntityQueryBuilder()
.WithAll<ComponentA, ComponentB, ComponentC, ComponentD>()
.WithAll<ComponentE, ComponentF, ComponentG>();
But can't use that directly with an idiomatic foreach
I could use a ToEntityArray() but I would have to query the components manually everytime with the entitymanager.
Is there any Solution on that side ?