Class TypeManager.TypeOverridesAttribute
[TypeOverrides] can be applied to a component that is known to never contain Entity and/or Blob references, in order to reduce time taken during serialization operations.
Namespace: Unity.Entities
Assembly: Unity.Entities.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)]
public class TypeManager.TypeOverridesAttribute : Attribute
Remarks
For example, a managed component containing a base class type field can only be determined to have entity or blob references at runtime since the runtime instance might hold a child type instance which does contain Entity and/or BlobAssetReferences. As such, serializing operations for managed components needs to walk runtime type instances which might be unnecessary. Use this attribute to prevent this walking to improve managed component serialization operations when you know the component type will never contain Entity and/or Blob references.
Constructors
Name | Description |
---|---|
TypeOverridesAttribute(bool, bool) |
Fields
Name | Description |
---|---|
HasNoBlobReferences | Force the component's BlobAssetRefOffsetCount to be zero if set to false. Otherwise, the value will only be zero if the component actually has a blob reference. |
HasNoEntityReferences | Force the component's HasEntityReferences to be false if set to true here. Otherwise, the value will only be false if the component actually has no entity references. |