public void Execute() { DynamicBuffer <PathPosition> pathPositionBuffer = pathPositionBufferFromEntity[entity]; pathPositionBuffer.Clear(); PathfindingParams pathfindingParams = pathfindingParamsComponentDataFromEntity[entity]; CalculatePath(startPosition, endPosition, pathPositionBuffer, pathFound); pathFollowComponentDataFromEntity[entity] = new PathFollow { pathIndex = pathPositionBuffer.Length - 2, NewPath = true }; var buffer = CostSoFar.GetUnsafePtr(); UnsafeUtility.MemClear(buffer, (long)CostSoFar.Length * UnsafeUtility.SizeOf <float>()); OpenSet.Clear(); }