docs.unity.cn
    Show / Hide Table of Contents

    Struct TypeManager.TypeInfo

    Provides information about component types such as their runtime size, how much space they use in Unity.Entities.Chunk storage, their TypeIndex, how many entity references they contain, and more.

    Namespace: Unity.Entities
    Syntax
    [GenerateTestsForBurstCompatibility]
    public readonly struct TypeInfo

    Constructors

    Name Description
    TypeInfo(Int32, TypeManager.TypeCategory, Int32, Int32, UInt64, UInt64, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Boolean, Int32, Int32, Int32, Int32, Int32)

    Used internally to construct a TypeInfo.

    Fields

    Name Description
    AlignmentInBytes

    The alignment requirement for the component. For buffer types, this is the alignment requirement of the element type.

    BlobAssetRefOffsetCount

    Number of BlobAssetReference<T>s this component can store.

    BufferCapacity

    The maximum number of elements that can be stored in a buffer component instance.

    Category TypeManager.TypeCategory
    ElementSize

    The size of an element store in buffer components. For non-buffer component types, this is the same as SizeInChunk

    EntityOffsetCount

    Number of Entity references this component can store.

    MaximumChunkCapacity

    Maximum number of instances of this component allowed to be stored in a Unity.Entities.Chunk.

    MemoryOrdering

    Sort order for component types in Unity.Entities.Chunk storage. By default this is equivalent to StableTypeHash. Order is sorted from lowest to highest.

    SizeInChunk

    The number of bytes used in a Unity.Entities.Chunk to store an instance of this component.

    StableTypeHash

    Hash used to uniquely identify a component based on its runtime memory footprint.

    TypeIndex TypeIndex
    TypeSize

    Blittable size of the component type.

    WeakAssetRefOffsetCount

    Number of WeakReference<T>s this component can store.

    WriteGroupCount

    Number of components which specify this component as the target type in a WriteGroupAttribute.

    Properties

    Name Description
    AlignmentInChunkInBytes

    Alignment of this type in a chunk. Normally the same as AlignmentInBytes, but that might be less than this value for buffer elements, whereas the buffer itself must be aligned to MaximumSupportedAlignment.

    BakingOnlyType IsBakingOnlyType
    DebugTypeName

    Provides a HPC# / Burst compatible name of the component type when building with DEBUG defined. Otherwise the name is empty.

    EnableableType IsEnableable
    HasBlobAssetRefs

    For struct IComponentData, a value of true gurantees that there are BlobAssetReference<T> fields in this component. For class based IComponentData, a value of true means it is possible, but not guaranteed, that there are blob asset references. (Polymorphic BlobAssetReference<T> members can not be proven statically)

    HasWeakAssetRefs

    For struct IComponentData, a value of true gurantees that there are WeakReference<T> fields in this component. For class based IComponentData, a value of true means it is possible, but not guaranteed, that there are WeakReferences. (Polymorphic WeakReference<T> members can not be proven statically)

    HasWriteGroups

    Returns true if a component with a WriteGroupAttribute specifies this component as it's targetType

    IsZeroSized

    Returns true if the component does not require space in Unity.Entities.Chunk memory

    TemporaryBakingType IsTemporaryBakingType
    Type

    Returns the System.Type for the component this TypeManager.TypeInfo is describing.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023