docs.unity.cn
    Show / Hide Table of Contents

    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.

    Inheritance
    Object
    Attribute
    TypeManager.TypeOverridesAttribute
    Namespace: Unity.Entities
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
    public class TypeOverridesAttribute : Attribute, _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(Boolean, Boolean) TypeManager.TypeOverridesAttribute

    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.

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