胡佳骏 94b73602dc 覆盖原有项目 преди 1 година
..
TriLib 94b73602dc 覆盖原有项目 преди 1 година
TriLibExtras a603062e8a 20230702 Create преди 1 година
LICENSE_Assimp.txt a603062e8a 20230702 Create преди 1 година
LICENSE_Assimp.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_LibTiff.txt a603062e8a 20230702 Create преди 1 година
LICENSE_LibTiff.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_Roboto.txt a603062e8a 20230702 Create преди 1 година
LICENSE_Roboto.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_SharpZipLib.txt a603062e8a 20230702 Create преди 1 година
LICENSE_SharpZipLib.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_TriLib.txt a603062e8a 20230702 Create преди 1 година
LICENSE_TriLib.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_UnityToolbag.txt a603062e8a 20230702 Create преди 1 година
LICENSE_UnityToolbag.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_ZLIB_MiniZip.txt a603062e8a 20230702 Create преди 1 година
LICENSE_ZLIB_MiniZip.txt.meta a603062e8a 20230702 Create преди 1 година
LICENSE_stb_image.txt a603062e8a 20230702 Create преди 1 година
LICENSE_stb_image.txt.meta a603062e8a 20230702 Create преди 1 година
README.MD a603062e8a 20230702 Create преди 1 година
README.MD.meta a603062e8a 20230702 Create преди 1 година
README_AvatarLoader.txt a603062e8a 20230702 Create преди 1 година
README_AvatarLoader.txt.meta a603062e8a 20230702 Create преди 1 година
README_TriLib.txt a603062e8a 20230702 Create преди 1 година
README_TriLib.txt.meta a603062e8a 20230702 Create преди 1 година
SAMPLES.MD a603062e8a 20230702 Create преди 1 година
SAMPLES.MD.meta a603062e8a 20230702 Create преди 1 година
Third-Party Notices.txt a603062e8a 20230702 Create преди 1 година
Third-Party Notices.txt.meta a603062e8a 20230702 Create преди 1 година
TriLib.meta a603062e8a 20230702 Create преди 1 година
TriLibExtras.meta a603062e8a 20230702 Create преди 1 година
TriLibVersion.txt a603062e8a 20230702 Create преди 1 година
TriLibVersion.txt.meta a603062e8a 20230702 Create преди 1 година

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.
}