I’m sorry if some documentation already explains this… I couldn’t find it.
I’m converting one of my ComponentSystem systems to SystemBase. I was wondering how I can specify an ‘or’ statement inside the Entity query?
In the OnCreate method, the following EntityQuery is created:
var oldParents = new EntityQueryDesc
{
None = new ComponentType[] {typeof(Interactable)},
All = new ComponentType[] {typeof(Tag_HasPopup)}
};
var deletedParents = new EntityQueryDesc
{
All = new ComponentType[] {typeof(DestroyEntity), typeof(Tag_HasPopup)}
};
_oldPopupParentsQuery = GetEntityQuery(oldParents, deletedParents);
The _oldPopupParentsQuery is used inside the OnUpdate method:
In the new SystemBase, this is not possible anymore. We cannot provide an entityquery in our Entities anymore. Most of my systems could easily be converted to SystemBase by using WithNone, WithAll, WithAny.
How would one create this where e.g. WithNone is only used if it just has the component Tag_HasPopup?
I could ofcourse create two Entities.Foreach(), but I was curious whether it would be possible in one statement.