docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EntityInstantiator

    Generates an Entity hierarchy from a glTF scene.

    Inheritance
    object
    EntityInstantiator
    Implements
    IInstantiator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cloud.Gltfast
    Assembly: Unity.Cloud.Gltfast.Dots.dll
    Syntax
    [MovedFrom(true, "GLTFast", "glTFast.dots", null)]
    public class EntityInstantiator : IInstantiator

    Constructors

    EntityInstantiator(IGltfReadable, Entity, ICodeLogger, InstantiationSettings)

    Constructs an EntityInstantiator.

    Declaration
    public EntityInstantiator(IGltfReadable gltf, Entity parent, ICodeLogger logger = null, InstantiationSettings settings = null)
    Parameters
    Type Name Description
    IGltfReadable gltf

    glTF to instantiate from.

    Entity parent

    Generated entities will be children of this entity.

    ICodeLogger logger

    Custom logger for reporting messages. Defaults to the shared Instance (writes to Unity's Console) when null is passed. Pass Instance (or new NullLogger()) to suppress all output.

    InstantiationSettings settings

    Instantiation settings.

    Fields

    m_Gltf

    Declaration
    protected IGltfReadable m_Gltf
    Field Value
    Type Description
    IGltfReadable

    m_Logger

    Logger used by this instantiator. May be null when the caller passed Instance; subclasses MUST use null-conditional access (m_Logger?.Error(...)).

    Declaration
    protected ICodeLogger m_Logger
    Field Value
    Type Description
    ICodeLogger

    m_Nodes

    Declaration
    protected Dictionary<uint, Entity> m_Nodes
    Field Value
    Type Description
    Dictionary<uint, Entity>

    m_Parent

    Declaration
    protected Entity m_Parent
    Field Value
    Type Description
    Entity

    m_Settings

    Declaration
    protected InstantiationSettings m_Settings
    Field Value
    Type Description
    InstantiationSettings

    Methods

    AddAnimation(AnimationClip[])

    Declaration
    public void AddAnimation(AnimationClip[] animationClips)
    Parameters
    Type Name Description
    AnimationClip[] animationClips

    AddCamera(uint, uint)

    Declaration
    public void AddCamera(uint nodeIndex, uint cameraIndex)
    Parameters
    Type Name Description
    uint nodeIndex
    uint cameraIndex

    AddLightPunctual(uint, uint)

    Declaration
    public void AddLightPunctual(uint nodeIndex, uint lightIndex)
    Parameters
    Type Name Description
    uint nodeIndex
    uint lightIndex

    AddMesh(uint, string, MeshResult, IReadOnlyList<uint>, uint?, IReadOnlyList<float>, int)

    Declaration
    public virtual void AddMesh(uint nodeIndex, string meshName, MeshResult meshResult, IReadOnlyList<uint> joints = null, uint? rootJoint = null, IReadOnlyList<float> morphTargetWeights = null, int meshNumeration = 0)
    Parameters
    Type Name Description
    uint nodeIndex
    string meshName
    MeshResult meshResult
    IReadOnlyList<uint> joints
    uint? rootJoint
    IReadOnlyList<float> morphTargetWeights
    int meshNumeration

    AddMeshInstanced(uint, string, MeshResult, uint, NativeArray<Vector3>?, NativeArray<Quaternion>?, NativeArray<Vector3>?, int)

    Declaration
    public virtual void AddMeshInstanced(uint nodeIndex, string meshName, MeshResult meshResult, uint instanceCount, NativeArray<Vector3>? positions, NativeArray<Quaternion>? rotations, NativeArray<Vector3>? scales, int meshNumeration = 0)
    Parameters
    Type Name Description
    uint nodeIndex
    string meshName
    MeshResult meshResult
    uint instanceCount
    NativeArray<Vector3>? positions
    NativeArray<Quaternion>? rotations
    NativeArray<Vector3>? scales
    int meshNumeration

    ApplyMeshNameFallback(uint, MeshResult)

    Applies the mesh-name fallback to a node, if it is still unnamed and the mesh carries a name.

    Declaration
    protected void ApplyMeshNameFallback(uint nodeIndex, MeshResult meshResult)
    Parameters
    Type Name Description
    uint nodeIndex

    Index of the node.

    MeshResult meshResult

    The mesh being assigned to it.

    BeginScene(string, IReadOnlyList<uint>)

    Declaration
    public void BeginScene(string name, IReadOnlyList<uint> nodeIndices)
    Parameters
    Type Name Description
    string name
    IReadOnlyList<uint> nodeIndices

    CreateNode(uint, uint?, double3, double4, double3, string)

    Declaration
    public virtual void CreateNode(uint nodeIndex, uint? parentIndex, double3 position, double4 rotation, double3 scale, string name)
    Parameters
    Type Name Description
    uint nodeIndex
    uint? parentIndex
    double3 position
    double4 rotation
    double3 scale
    string name

    EndScene(IReadOnlyList<uint>)

    Declaration
    public virtual void EndScene(IReadOnlyList<uint> rootNodeIndices)
    Parameters
    Type Name Description
    IReadOnlyList<uint> rootNodeIndices

    SetFallbackNodeName(uint, string)

    Names a node the glTF left unnamed, once, with the first non-empty name among its meshes.

    Declaration
    protected virtual void SetFallbackNodeName(uint nodeIndex, string meshName)
    Parameters
    Type Name Description
    uint nodeIndex

    Index of the node to name.

    string meshName

    The resolved fallback name.

    Remarks

    Not called when no mesh supplies a name; the Node- placeholder stands instead.

    Implements

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