DGJQN 1cfbece64c 2023 0524 Init 1 year ago
..
TriLib 1cfbece64c 2023 0524 Init 1 year ago
TriLibExtras 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_Assimp.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_Assimp.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_LibTiff.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_LibTiff.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_Roboto.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_Roboto.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_SharpZipLib.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_SharpZipLib.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_TriLib.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_TriLib.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_UnityToolbag.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_UnityToolbag.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_ZLIB_MiniZip.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_ZLIB_MiniZip.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_stb_image.txt 1cfbece64c 2023 0524 Init 1 year ago
LICENSE_stb_image.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
README.MD 1cfbece64c 2023 0524 Init 1 year ago
README.MD.meta 1cfbece64c 2023 0524 Init 1 year ago
README_AvatarLoader.txt 1cfbece64c 2023 0524 Init 1 year ago
README_AvatarLoader.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
README_TriLib.txt 1cfbece64c 2023 0524 Init 1 year ago
README_TriLib.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
SAMPLES.MD 1cfbece64c 2023 0524 Init 1 year ago
SAMPLES.MD.meta 1cfbece64c 2023 0524 Init 1 year ago
Third-Party Notices.txt 1cfbece64c 2023 0524 Init 1 year ago
Third-Party Notices.txt.meta 1cfbece64c 2023 0524 Init 1 year ago
TriLib.meta 1cfbece64c 2023 0524 Init 1 year ago
TriLibExtras.meta 1cfbece64c 2023 0524 Init 1 year ago
TriLibVersion.txt 1cfbece64c 2023 0524 Init 1 year ago
TriLibVersion.txt.meta 1cfbece64c 2023 0524 Init 1 year ago

README.MD

Basic usage

Synchronous model loading:

using (var assetLoader = new AssetLoader()) {
    var assetLoaderOptions = AssetLoaderOptions.CreateInstance();   //Creates the AssetLoaderOptions instance.
                                                                    //AssetLoaderOptions let you specify options to load your model.
                                                                    //(Optional) You can skip this object creation and it's parameter or pass null.
    
    //You can modify assetLoaderOptions before passing it to LoadFromFile method. You can check the AssetLoaderOptions API reference at:
    //https://ricardoreis.net/trilib/manual/html/class_tri_lib_1_1_asset_loader_options.html
    
    var wrapperGameObject = gameObject;                             //Sets the game object where your model will be loaded into.
                                                                    //(Optional) You can skip this object creation and it's parameter or pass null.

    var myGameObject = assetLoader.LoadFromFile("PATH TO MY FILE.FBX", assetLoaderOptions, wrapperGameObject); //Loads the model synchronously and stores the reference in myGameObject.
}

Asynchronous model loading:

using (var assetLoaderAsync = new AssetLoaderAsync()) {
    var assetLoaderOptions = AssetLoaderOptions.CreateInstance();   //Creates the AssetLoaderOptions instance.
                                                                    //AssetLoaderOptions let you specify options to load your model.
                                                                    //(Optional) You can skip this object creation and it's parameter or pass null.
    
    //You can modify assetLoaderOptions before passing it to LoadFromFile method. You can check the AssetLoaderOptions API reference at:
    //https://ricardoreis.net/trilib/manual/html/class_tri_lib_1_1_asset_loader_options.html
    
    var wrapperGameObject = gameObject;                             //Sets the game object where your model will be loaded into.
                                                                    //(Optional) You can skip this object creation and it's parameter or pass null.

    var thread = assetLoaderAsync.LoadFromFile("PATH TO MY FILE.FBX", assetLoaderOptions, wrapperGameObject, delegate(GameObject myGameObject) {
        //Here you can get the reference to the loaded model using myGameObject.
    }); //Loads the model asynchronously and returns the reference to the created Task/Thread.
}