Unmanaged components
Unmanaged components store the most common data types which means they're useful in the majority of use-cases.
Unmanaged components can store fields of the following types:
- Blittable types
bool
char
BlobAssetReference<T>
(a reference to a Blob data structure)Collections.FixedString
(a fixed-sized character buffer)Collections.FixedList
- Fixed array (only allowed in an unsafe context)
- Other structs that conform to these same restrictions
Create an unmanaged component
To create an unmanaged component, create a struct that inherits from IComponentData
.
The following code sample shows an unmanaged component:
public struct ExampleUnmanagedComponent : IComponentData
{
public int Value;
}
Add fields that use compatible types to the struct to define data for the component. If you don't add any fields to the component, it acts as a tag component.