docs.unity3d.com
Search Results for

    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
    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)

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)