Class GltfLoader
Static utility class for loading GLB/GLTF files. Provides convenient static methods that wrap GltfImporter.
public static class GltfLoader
- Inheritance
-
GltfLoader
- Inherited Members
Methods
Load(byte[], Shader?)
Load a GLB or GLTF model from bytes. Automatically detects format.
public static GameObject? Load(byte[] data, Shader? shader = null)
Parameters
databyte[]GLB or JSON bytes
shaderShaderOptional shader for materials
Returns
- GameObject
The root GameObject of the imported model
LoadFromFile(string, Shader?)
Load a GLTF/GLB model from a file path.
public static GameObject? LoadFromFile(string filePath, Shader? shader = null)
Parameters
filePathstringPath to the GLTF or GLB file
shaderShaderOptional shader for materials
Returns
- GameObject
The root GameObject of the imported model
LoadFromJson(string, string, Shader?)
Load a GLTF model from JSON text.
public static GameObject? LoadFromJson(string json, string basePath, Shader? shader = null)
Parameters
jsonstringGLTF JSON string
basePathstringBase directory for external resources
shaderShaderOptional shader for materials
Returns
- GameObject
The root GameObject of the imported model
LoadGlb(byte[], Shader?)
Load a GLB model from bytes.
public static GameObject? LoadGlb(byte[] glbBytes, Shader? shader = null)
Parameters
glbBytesbyte[]Raw GLB bytes
shaderShaderOptional shader for materials
Returns
- GameObject
The root GameObject of the imported model