Class EntityInstantiator
Generates an Entity hierarchy from a glTF scene.
Inheritance
EntityInstantiator
Assembly: Unity.Cloud.Gltfast.Dots.dll
Syntax
[MovedFrom(true, "GLTFast", "glTFast.dots", null)]
public class EntityInstantiator : IInstantiator
Constructors
EntityInstantiator(IGltfReadable, Entity, ICodeLogger, InstantiationSettings)
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
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
m_Nodes
Declaration
protected Dictionary<uint, Entity> m_Nodes
Field Value
m_Parent
Declaration
protected Entity m_Parent
Field Value
m_Settings
Declaration
protected InstantiationSettings m_Settings
Field Value
Methods
AddAnimation(AnimationClip[])
Declaration
public void AddAnimation(AnimationClip[] animationClips)
Parameters
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
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
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
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
EndScene(IReadOnlyList<uint>)
Declaration
public virtual void EndScene(IReadOnlyList<uint> rootNodeIndices)
Parameters
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.
|
Implements