TriLib 2.3.8
|
Represents the main class containing methods to load the Models. More...
Static Public Member Functions | |
static AssetLoaderContext | LoadModelFromFile (string path, Action< AssetLoaderContext > onLoad=null, Action< AssetLoaderContext > onMaterialsLoad=null, Action< AssetLoaderContext, float > onProgress=null, Action< IContextualizedError > onError=null, GameObject wrapperGameObject=null, AssetLoaderOptions assetLoaderOptions=null, object customContextData=null, bool haltTask=false, Action< AssetLoaderContext > onPreLoad=null, bool isZipFile=false) |
Loads a Model from the given path asynchronously. | |
static AssetLoaderContext | LoadModelFromStream (Stream stream, string filename=null, string fileExtension=null, Action< AssetLoaderContext > onLoad=null, Action< AssetLoaderContext > onMaterialsLoad=null, Action< AssetLoaderContext, float > onProgress=null, Action< IContextualizedError > onError=null, GameObject wrapperGameObject=null, AssetLoaderOptions assetLoaderOptions=null, object customContextData=null, bool haltTask=false, Action< AssetLoaderContext > onPreLoad=null, bool isZipFile=false) |
Loads a Model from the given Stream asynchronously. | |
static AssetLoaderContext | LoadModelFromFileNoThread (string path, Action< IContextualizedError > onError=null, GameObject wrapperGameObject=null, AssetLoaderOptions assetLoaderOptions=null, object customContextData=null, bool isZipFile=false) |
Loads a Model from the given path synchronously. | |
static AssetLoaderContext | LoadModelFromStreamNoThread (Stream stream, string filename=null, string fileExtension=null, Action< IContextualizedError > onError=null, GameObject wrapperGameObject=null, AssetLoaderOptions assetLoaderOptions=null, object customContextData=null, bool isZipFile=false) |
Loads a Model from the given Stream synchronously. | |
static AssetLoaderOptions | CreateDefaultLoaderOptions (bool generateAssets=false, bool supressWarning=false) |
Creates an Asset Loader Options with the default settings and Mappers. | |
static ScriptableObject | LoadOrCreateScriptableObjectSafe (string typeName, string typeNamespace, string directory, bool instantiate) |
Tries to load an ScriptableObject, or creates it with the given parameters if the ScriptableObject can't be found. | |
static MaterialMapper | GetSelectedMaterialMapper (bool instantiate) |
Returns the Material Mapper configured for the Unity project. | |
static string | GetCompatibleMaterialMapperName () |
Gets the name of a compatible Material Mapper based on the render pipeline. | |
Represents the main class containing methods to load the Models.
|
static |
Creates an Asset Loader Options with the default settings and Mappers.
generateAssets | Indicates whether created Scriptable Objects will be saved as assets. |
supressWarning | Pass true if you are caching your AssetLoaderOptions instance. |
|
static |
Gets the name of a compatible Material Mapper based on the render pipeline.
null
.
|
static |
Returns the Material Mapper configured for the Unity project.
instantiate | Pass true to instantiate a new Material Mapper, or false to use the Material Mapper prefab instead. |
null
.
|
static |
Loads a Model from the given path asynchronously.
path | The Model file path. |
onLoad | The Method to call on the Main Thread when the Model is loaded but resources may still pending. |
onMaterialsLoad | The Method to call on the Main Thread when the Model and resources are loaded. |
onProgress | The Method to call when the Model loading progress changes. |
onError | The Method to call on the Main Thread when any error occurs. |
wrapperGameObject | The Game Object that will be the parent of the loaded Game Object. Can be null. |
assetLoaderOptions | The options to use when loading the Model. |
customContextData | The Custom Data that will be passed along the Context. |
haltTask | Turn on this field to avoid loading the model immediately and chain the Tasks. |
onPreLoad | The method to call on the parallel Thread before the Unity objects are created. |
isZipFile | Indicates whether to load from a Zip file. |
|
static |
Loads a Model from the given path synchronously.
path | The Model file path. |
onError | The Method to call on the Main Thread when any error occurs. |
wrapperGameObject | The Game Object that will be the parent of the loaded Game Object. Can be null. |
assetLoaderOptions | The options to use when loading the Model. |
customContextData | The Custom Data that will be passed along the Context. |
isZipFile | Indicates whether to load from a Zip file. |
|
static |
Loads a Model from the given Stream asynchronously.
stream | The Stream containing the Model data. |
filename | The Model filename. |
fileExtension | The Model file extension. (Eg.: fbx) |
onLoad | The Method to call on the Main Thread when the Model is loaded but resources may still pending. |
onMaterialsLoad | The Method to call on the Main Thread when the Model and resources are loaded. |
onProgress | The Method to call when the Model loading progress changes. |
onError | The Method to call on the Main Thread when any error occurs. |
wrapperGameObject | The Game Object that will be the parent of the loaded Game Object. Can be null. |
assetLoaderOptions | The options to use when loading the Model. |
customContextData | The Custom Data that will be passed along the Context. |
haltTask | Turn on this field to avoid loading the model immediately and chain the Tasks. |
onPreLoad | The method to call on the parallel Thread before the Unity objects are created. |
isZipFile | Indicates whether to load from a Zip file. |
|
static |
Loads a Model from the given Stream synchronously.
stream | The Stream containing the Model data. |
filename | The Model filename. |
fileExtension | The Model file extension. (Eg.: fbx) |
onError | The Method to call on the Main Thread when any error occurs. |
wrapperGameObject | The Game Object that will be the parent of the loaded Game Object. Can be null. |
assetLoaderOptions | The options to use when loading the Model. |
customContextData | The Custom Data that will be passed along the Context. |
isZipFile | Indicates whether to load from a Zip file. |
|
static |
Tries to load an ScriptableObject, or creates it with the given parameters if the ScriptableObject can't be found.
typeName | The ScriptableObject type name. |
typeNamespace | The ScriptableObject type namespace. |
directory | The directory where the ScriptableObject instance might be. |
instantiate | Turn on this field to instantiate the ScriptableObject. |
null
.