Represents an asset downloader. Add this MonoBehaviour to any GameObject and set AssetURI and AssetExtension to automatically download the referenced model.
More...
|
bool | DownloadAsset (string assetURI, string assetExtension, ObjectLoadedHandle onAssetLoaded=null, TexturePreLoadHandle onTexturePreLoad=null, AssetLoaderOptions options=null, GameObject wrapperGameObject=null, AssimpInterop.ProgressCallback progressCallback=null) |
| Downloads an asset. More...
|
|
|
void | Start () |
| Checks the AssetURI and AssetExtension and starts downloading the asset, if both are avaliable. More...
|
|
void | OnGUI () |
| Shows the progress on screen, if ShowProgress is set to true . More...
|
|
Represents an asset downloader. Add this MonoBehaviour to any GameObject and set AssetURI and AssetExtension to automatically download the referenced model.
Enable TRILIB_USE_ZIP compiler symbol manually or tick "Enable Zip loading" on TriLib menu to enable ZIP files processing.
◆ DownloadAsset()
bool TriLib.AssetDownloader.DownloadAsset |
( |
string |
assetURI, |
|
|
string |
assetExtension, |
|
|
ObjectLoadedHandle |
onAssetLoaded = null , |
|
|
TexturePreLoadHandle |
onTexturePreLoad = null , |
|
|
AssetLoaderOptions |
options = null , |
|
|
GameObject |
wrapperGameObject = null , |
|
|
AssimpInterop.ProgressCallback |
progressCallback = null |
|
) |
| |
Downloads an asset.
- Returns
true
, if asset was downloaded, false
otherwise.
- Parameters
-
assetURI | Asset URI. |
assetExtension | Asset extension. |
onAssetLoaded | On asset loaded event. |
onTexturePreLoad | On texture pre load event. |
options | Asset loading options. |
wrapperGameObject | Wrapper UnityEngine.GameObject to load the asset into. |
progressCallback | Callback used to retrieve file loading percentage. |
◆ OnGUI()
void TriLib.AssetDownloader.OnGUI |
( |
| ) |
|
|
protected |
Shows the progress on screen, if ShowProgress is set to true
.
◆ Start()
void TriLib.AssetDownloader.Start |
( |
| ) |
|
|
protected |
Checks the AssetURI and AssetExtension and starts downloading the asset, if both are avaliable.
◆ AssetExtension
string TriLib.AssetDownloader.AssetExtension |
Use this field to set the asset extension. (Eg: ".FBX")
Use ".ZIP" for ZIP files.
◆ AssetURI
string TriLib.AssetDownloader.AssetURI |
Use this field to set the asset URI.
◆ Async
bool TriLib.AssetDownloader.Async |
Enable this field to load models asynchronously.
◆ AutoStart
bool TriLib.AssetDownloader.AutoStart = true |
Turn on this field to start the download automatically.
◆ ProgressCallback
AssimpInterop.ProgressCallback TriLib.AssetDownloader.ProgressCallback |
Use this field to pass a method that will be called on model loading progress.
◆ ShowProgress
bool TriLib.AssetDownloader.ShowProgress |
Enable this field to show loading progress on GUI.
◆ Timeout
int TriLib.AssetDownloader.Timeout = 2000 |
Use this field to set the download timeout in seconds.
◆ WrapperGameObject
GameObject TriLib.AssetDownloader.WrapperGameObject |
Use this field to set the UnityEngine.GameObject to load the asset into.
◆ Error
string TriLib.AssetDownloader.Error |
|
get |
Gets the last error message.
The error message.
◆ HasStarted
bool TriLib.AssetDownloader.HasStarted |
|
get |
Gets a value indicating whether the download has started.
true
if this download has started; otherwise, false
.
◆ IsDone
bool TriLib.AssetDownloader.IsDone |
|
get |
Gets a value indicating whether the download is done.
true
if this download is done; otherwise, false
.
◆ Progress
float TriLib.AssetDownloader.Progress |
|
get |
Gets the download progress.
The download progress.
The documentation for this class was generated from the following file: