public IEnumerable <IGridEntity> Select(Vector3 From) { var h = height * 0.5f; var w = width * 0.5f; return(targetGrid.GetEntitiesInRange( From + new Vector3(-w, 0, -h), From + new Vector3(w, 0, h), x => true)); }
public IEnumerable <IGridEntity> SelectQuery(Vector3 From) { //Si es una esfera //creo una "caja" con las dimensiones deseadas, y luego filtro segun distancia para formar el cĂrculo return(targetGrid.GetEntitiesInRange( From + new Vector3(-radius, 0, -radius), From + new Vector3(radius, 0, radius), entityPos => { var position2d = entityPos - From; position2d.y = 0; return position2d.sqrMagnitude < radius * radius; //Una forma mas "performante" de comparar distancias })); }