LeanLoader Class
Load assets from the web and cache them for faster performance and offline use
Constructor
LeanLoader
()
Item Index
Methods
LeanLoader.deleteCache
-
dataURL:String
Remove a specific cached item
Parameters:
-
dataURL:String
StringThe path of the asset you want to delete from the cache
LeanLoader.deleteCacheAll
()
Removes all of the LeanLoader cached items from the PlayerPrefs
LeanLoader.load
-
dataURL:String
-
options:LLOptions
Load an asset from the internet
Parameters:
-
dataURL:String
StringURL of the data you wish to load
-
options:LLOptions
LLOptionsThe optional parameters you wish to specify for the loading of the asset (use caching, onComplete handlers, etc...)
Returns:
Returns a LeanLoading object where you can track the assets progress, and other attributes
Example:
Javascript:
LeanLoader.load("http://dentedpixel.com/assets/Monkeyshines.png", LLOptions().setOnComplete( imageLoaded ).setUseCache( true ));
function imageLoaded( tex:Texture2D ){
Debug.Log("image loaded:"+tex);
}
C#:
LeanLoader.load("http://dentedpixel.com/assets/Monkeyshines.png", new LLOptions().setOnComplete( imageLoaded ).setUseCache( true ));
void imageLoaded( Texture2D tex ){
Debug.Log("image loaded:"+tex);
}