TriLib  1.6
TriLib Unity Package
TriLib 1.6 Documentation

Hi!

This is the TriLib official documentation.

The easiest way to load a model is following the sample:

GameObject myGameObject;
try {
using (var assetLoader = new AssetLoader()) {
gameObject = assetLoader.LoadFromFile("mymodel.fbx");
}
} catch (Exception e) {
Debug.LogFormat("Unable to load mymodel.fbx. The loader returned: {0}", e);
}

If you prefer to load your model from memory, you can use:

GameObject myGameObject;
try {
using (var assetLoader = new AssetLoader()) {
//In case you don't have a valid filename, set this to the file extension
//to help TriLib assigining a file loader to this file
//example value: ".fbx"
var filename = "c:/models/mymodel.fbx";
var fileData = File.ReadAllBytes(filename);
gameObject = assetLoader.LoadFromMemory(fleData, filename);
}
} catch (Exception e) {
Debug.LogFormat("Unable to load mymodel.fbx. The loader returned: {0}", e);
}

The entire TriLib package has many classes, but here are the most important ones:

AssetLoader (main class used to load models)
AssetLoaderOptions (class used to specity model loading options)
AssetAdvancedConfig (class used to specity advanced model loading parameters)