- Home /
Question by
Tomas_Otto · Aug 21, 2020 at 12:17 PM ·
componentsdots
Class as a member of IComponentData struct?
Hello, I want to put a simple class into IComponentData struct but unity tells me it is not either primitive or blittable - can I do something about this?
Comment
https://docs.unity3d.com/Packages/com.unity.entities@0.14/api/Unity.Entities.IComponentData.html
An IComponentData implementation must be a struct and can only contain unmanaged, blittable types, including:
C#-defined blittable types
bool
char
(a fixed-sized character buffer)
BlobAssetReference (a reference to a Blob data structure)
fixed arrays (in an unsafe context)
structs containing these unmanaged, blittable fields
Okay, thank you - will find another way to make it work
You may want to define simple class
and provide some reasoning behind it.