docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TypeManager.ForceReferenceAttribute

    [ForceReferenceSearch] can be applied to a managed component that is known to contain Entity, Blob and/or UnityObject references, in case that the reference is nested beyond the max search depth and can therefore not normally be found.

    Inheritance
    object
    Attribute
    TypeManager.ForceReferenceAttribute
    Namespace: Unity.Entities
    Assembly: Unity.Entities.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)]
    public class TypeManager.ForceReferenceAttribute : Attribute
    Remarks

    If a type nesting exceeds the max search depth without finding a reference type, it will assume there are none to be found to avoid a heavy (potentially unnecessary) performance cost of recursing further down. If you know that there is a reference further down that needs to be caught and the performance hit is acceptable you can add this attribute to forcibly mark the type as having a certain type of reference.

    Constructors

    Name Description
    ForceReferenceAttribute(bool, bool, bool)

    TypeManager.ForceReferenceAttribute

    Fields

    Name Description
    HasBlobReferences

    Configures the TypeManager to force the component to be marked to have BlobAssetReferences. Otherwise, this will only be set if the component actually has a blob reference that can be found before the maxdepth is hit.

    HasEntityReferences

    Force the component's HasEntityReferences to be true if set to true here. Otherwise, the value will only be true if the component actually has entity references that can be found before the maxdepth is hit.

    HasUnityObjectReferences

    Configures the TypeManager to force the component to be marked to have UnityObjectReferences. Otherwise, this will only be set if the component actually has a UnityObjectReferences that can be found before the maxdepth is hit.

    In This Article
    Back to top
    Copyright © 2025 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)