Like this , runtime show error :
E:\fzy\DOTS\EntityComponentSystemSamples-master\ECSSamples\Assets\a-MyDots\02-Wander\WanderSystem.cs(20,5): Burst error BC1020: Boxing a valuetype float to a managed object is not supported.
If I remove UnityEngine.Debug.Log(angle) there is not error
protected override void OnUpdate()
{
float deltaTime = Time.DeltaTime;
Entities.WithBurst(FloatMode.Default, FloatPrecision.Standard, true).ForEach((ref Translation trans, ref WanderComponent com) => {
if (!com.isSignDest)
{
com.isSignDest = true;
com.isArriveDest = false;
var random = new Random((uint)((trans.Value.x * 1000f % 1000f) + 1));
float angle = random.NextFloat(0f, 180f);
UnityEngine.Debug.Log(angle);
float rad = math.degrees(angle);
float x = com.radius * math.cos(rad);
float z = com.radius * math.sin(rad);
com.dest = math.float3(x, 0, z);
}
if (com.isSignDest && !com.isArriveDest)
{
trans.Value += math.normalize((com.dest - trans.Value)) * com.speed * deltaTime;
if (math.abs(math.distance(trans.Value, com.dest)) <= 0.001f)
{
com.isSignDest = false;
com.isArriveDest = true;
}
}
}).ScheduleParallel();
}