docs.unity.cn
    Show / Hide Table of Contents

    Struct EntityPrefabReference

    Weak reference to entity prefab. Entity prefabs are GameObjects that have been fully converted into entity data during the import/build process.

    Namespace: Unity.Entities.Serialization
    Syntax
    [Serializable]
    public struct EntityPrefabReference : IEquatable<EntityPrefabReference>

    Constructors

    Name Description
    EntityPrefabReference(Hash128)

    Construct an EntityPrefabReference from a GUID.

    EntityPrefabReference(GameObject)

    Construct an EntityPrefabReference from a GameObject.

    Properties

    Name Description
    AssetGUID

    Returns the prefab GUID.

    IsReferenceValid

    Returns true if the reference has a valid id. In the editor, additional checks for the correct GenerationType and the existence of the referenced asset are performed.

    Methods

    Name Description
    Equals(Object)

    Overrides the default Object.Equals method.

    Equals(EntityPrefabReference)

    Checks if this reference holds the same asset GUID as the other reference.

    GetHashCode()

    Overrides the default Object.GetHashCode method.

    Operators

    Name Description
    Equality(EntityPrefabReference, EntityPrefabReference)
    Inequality(EntityPrefabReference, EntityPrefabReference)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023