struct Component : IComponentData {
public BlobAssetReferece<T> Value;
}
as just
struct Component : IComponentData {
public T* Value;
}
?
my thinking is that if the blob’s lifetime is controlled elsewhere, then there’s no point of boxing T. its just extra fluff since all a blob asset reference is it seems is a container around a pointer that essentially does this
struct BlobAssetReferece<T> {
T *m_Field;
public T Get() => *m_Field;
}
also i like wacky symbols like → * that make the source code look cool
I think intent is important. The blob structs are designed for a certain purpose.
If I see a random pointer on a component, I have no idea who or what is responsible for lifetime management and freeing the resource. Whereas if I see a BlobAssetReference I know how it should be handled.
There’s also NativeReference, which you won’t be attaching on a component, but provides a safe way to access unmanaged memory.