public UpdateUnitShooting(UnitContext unitContext) { var idx = new EntityIndex <UnitEntity, int>( unitContext.GetGroup(UnitMatcher.Team), (entity, component) => { var team = component as Team; return(team != null ? team.id : entity.team.id); }); unitContext.AddEntityIndex(TARGETS_INDEX_NAME, idx); _units = unitContext; _shooters = unitContext.GetGroup(UnitMatcher.Team); }
public UpdateShootingCooldown(UnitContext units, GlobalsContext globals) { _cooldownUnits = units.GetGroup(UnitMatcher.ShootingCooldown); _globals = globals; }