Hi,
I have this IComponentData:
public struct DaytimeLight: IComponentData
{
public NativeArray<int> Timestamp;
public NativeArray<float> Intensities;
}
and this is the part of the proxy script where I initialize the values:
public class DaytimeLightProxy : MonoBehaviour, IConvertGameObjectToEntity
{
[SerializeField] private Light light;
[SerializeField] private DaytimeLightSnapshot[] snapshots;
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
NativeArray<int> timestamps = new NativeArray<int>(snapshots.Length, Allocator.Temp);
NativeArray<float> intensities = new NativeArray<float>(snapshots.Length, Allocator.Temp);
for (int i = 0; i < snapshots.Length; i++)
{
timestamps[i] = snapshots[i].Timestamp;
intensities[i] = snapshots[i].Intensity;
}
var lightData = new DaytimeLight
{
Timestamps = timestamps,
Intensities = intensities
};
dstManager.SetName(entity,"DaytimeLight");
dstManager.AddComponentData(entity, lightData);
dstManager.AddComponentObject(entity, light);
}
And the error I get:
ArgumentException: DaytimeSystems.DaytimeLight contains a field of Unity.Collections.LowLevel.Unsafe.DisposeSentinel, which is neither primitive nor blittable.
Any idea of what I am doing wrong here?