How can I display NativeArray in my Entity Inspector?

Hello,

I’m wondering how can I display the content of a NativeArray from a Component when I focus an Entity in the Entities Hierarchy/Inspector?

public struct Pawn : IComponentData
{
    public int LifePoints;
    public NativeArray<int> Lifes;
}

image

It seems like the NativeArray is detected by the inspector, but not its content. I don’t want to modify it, neither display it in MonoBehaviour/SO or somewhere else. If I can’t display it in Entities inspector, I want to understand why Unity is pushing hard NativeArray for DOTS usage but not let us debug them properly?

Also, which alternative(s) do I have instead to get arrays in components that I can debug in inspector?

You could use DynamicBuffer instead of NativeArray, it’s separate from your IComponentData though. So when you access Pawn from a system you would also need to get the Lives buffer separately.