{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class GameObjectInstantiator | Unity glTFast | 6.0.1
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameObjectInstantiator

    Generates a GameObject hierarchy from a glTF scene

    Inheritance
    object
    GameObjectInstantiator
    GameObjectBoundsInstantiator
    Implements
    IInstantiator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: GLTFast
    Assembly: solution.dll
    Syntax
    public class GameObjectInstantiator : IInstantiator

    Constructors

    Name Description
    GameObjectInstantiator(IGltfReadable, Transform, ICodeLogger, InstantiationSettings)

    Constructs a GameObjectInstantiator

    Fields

    Name Description
    m_Gltf

    glTF to instantiate from

    m_Logger

    Instantiation logger

    m_Nodes

    glTF node index to instantiated GameObject dictionary

    m_Parent

    Generated GameObjects will get parented to this Transform

    m_Settings

    Instantiation settings

    Properties

    Name Description
    SceneInstance

    Contains information about the latest instance of a glTF scene

    SceneTransform

    Transform representing the scene. Root nodes will get parented to it.

    Methods

    Name Description
    AddAnimation(AnimationClip[])

    Adds animation clips to the current scene. Only available if the built-in Animation module is enabled.

    AddCamera(uint, uint)

    Called when a node has a camera assigned

    AddLightPunctual(uint, uint)

    Called when a node has a punctual light assigned (KHR_lights_punctual)

    AddPrimitive(uint, string, MeshResult, uint[], uint?, float[], int)

    Called for adding a Primitive/Mesh to a Node.

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

    Called for adding a Primitive/Mesh to a Node that uses GPU instancing (EXT_mesh_gpu_instancing) to render the same mesh/material combination many times. Similar to/called instead of AddPrimitive(uint, string, MeshResult, uint[], uint?, float[], int), without joints/skin support.

    BeginScene(string, uint[])

    Starts creating a scene instance. Has to be called at first and concluded by calling EndScene(uint[]).

    CreateNode(uint, uint?, Vector3, Quaternion, Vector3)

    Called for every Node in the glTF file

    EndScene(uint[])

    Is called at last, after all scene content has been created. Immediately afterwards the scene will be rendered, so use it to finally prepare the instance.

    SetNodeName(uint, string)

    Sets the name of a node. If a node has no name it falls back to the first valid mesh name. Null otherwise.

    Events

    Name Description
    EndSceneCompleted

    Invoked after a scene has been instantiated.

    MeshAdded

    Invoked after a mesh was added to a node GameObject

    NodeCreated

    Invoked when a node's GameObject has been created.

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