#Queries in general

1 messages · Page 1 of 1 (latest)

faint ridge
#

Im comletly new to dots and checked out the documentation on creating queries.
My problem is, I seeing multiple solutions on how to query my entities. One being Aspects or creating a EntityQuery or SystemAPI.Query.
Can someone do a quick sumary for me for what to use when?

A simple usecase I have is that I want to query for LocalTransform and an other custom Component of mine.

small grove
#

If it were me, I'd start with something like

var query = new EntityQueryBuilder(Allocator.Temp)
    .WithAll<LocalTransform,MyCustomComponent>()
    .Build(ref systemState);

(Assuming I'm in an ISystem OnCreate(); otherwise the parameter passed to .Build() is different, but everything else is the same).

#

That's the most explicit option.