Class GltfImport
Loads a glTF's content, converts it to Unity resources and is able to feed it to an IInstantiator for instantiation. Uses the efficient and fast JsonUtility/GltfJsonUtilityParser for JSON parsing.
Implements
Inherited Members
Namespace: GLTFast
Assembly: glTFast.dll
Syntax
public class GltfImport : GltfImportBase<Root>, IDisposable, IGltfReadable<Root>, IGltfReadable, IMaterialProvider, IMaterialsVariantsProvider
Constructors
GltfImport(IDownloadProvider, IDeferAgent, IMaterialGenerator, ICodeLogger)
Constructs a GltfImport instance with injectable customization objects.
Declaration
public GltfImport(IDownloadProvider downloadProvider = null, IDeferAgent deferAgent = null, IMaterialGenerator materialGenerator = null, ICodeLogger logger = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IDownloadProvider | downloadProvider | Provides file access or download customization |
| IDeferAgent | deferAgent | Provides custom update loop behavior for better frame rate control |
| IMaterialGenerator | materialGenerator | Provides custom glTF to Unity material conversion |
| ICodeLogger | logger | Provides custom message logging |
Methods
ParseJson(string)
De-serializes a glTF JSON string and returns the glTF root schema object.
Declaration
protected override RootBase ParseJson(string json)
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | glTF JSON |
Returns
| Type | Description |
|---|---|
| RootBase | De-serialized glTF root object. |