#Proper HasComponent call from IJobEntity Execute

1 messages · Page 1 of 1 (latest)

drowsy jackal
#

What is the proper way to call HasComponent on an IJobEntity struct in the Execute method.
Execute( in Component1 c1, in Component2 c2, in Entity entity)
{
bool hasC3 = (what goes here).HasComponent<Component3>(entity);

I know a ComponentLookup<Component3> passed into the job can be used, but that doesn't seem correct, if I want to call HasComponent on the entity from parameter. Is there a state.EntityManager or can I / should I pass in a SystemHandle, or is something else intrinsic available?

idle holly
#

ComponentLookup<T> is the best solution I'm aware of, unless one of my teammates is going to surprise me and say we have a sourcegen-based wrapper to simplify the interface.