Is there any way to get transform component from entity? I know, there is new library for it, cant find. I could find only Translation. Maybe it's related with another way of getting entities? Maybe with query.
Can anyone help. Thanks.

There isn't really a "transform" like the one that gameobjects have, but I suspect you're looking for LocalToWorld. Along with having a position property, it has things like Rotation, Up, Forward, etc. And it contains a matrix that you can use to multiply with a position to convert to to world coordinates. If you want to go from world to local, invert the matrix before doing the multiplication.
LocalToWorld is a world transform. Both Translation and Rotation are local space.
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
float3 point = new float3( 0 , 0 , 0 );
Entities
.ForEach( ( in LocalToWorld transform ) =>
{
float dist = math.distance( point , transform.Position );
if( dist<5 )
{
/* something happens */
}
} )
.WithBurst().ScheduleParallel();
ComponentDataFromEntity<Translation> allTranslations = GetComponentDataFromEntity<Translation>(true);
....
public class TargetToDirectionSystem : SystemBase
{
protected override void OnUpdate()
{
Entities.
WithNone<PlayerTag>().
WithAll<ChaserTag>().
ForEach((ref MoveData moveData, ref Rotation rot, in Translation pos, in TargetData targetData) =>
{
ComponentDataFromEntity<Translation> allTranslations = GetComponentDataFromEntity<Translation>(true);
if (!allTranslations.Exists(targetData.targetEntity))
{
return;
}
Translation targetPos = allTranslations[targetData.targetEntity];
float3 dirToTarget = targetPos.Value - pos.Value;
moveData.direction = dirToTarget;
}).Run();
}
}