Table of Contents

Class GltfLoader

Namespace
S1MAPI.Gltf
Assembly
S1MAPI_Mono.dll

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

data byte[]

GLB or JSON bytes

shader Shader

Optional 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

filePath string

Path to the GLTF or GLB file

shader Shader

Optional 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

json string

GLTF JSON string

basePath string

Base directory for external resources

shader Shader

Optional 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

glbBytes byte[]

Raw GLB bytes

shader Shader

Optional shader for materials

Returns

GameObject

The root GameObject of the imported model