Class AssetBundle
- Namespace
- Lime
- Assembly
- Lime.dll
public abstract class AssetBundle : IDisposable
- Inheritance
-
AssetBundle
- Implements
- Derived
- Inherited Members
Properties
Current
public static AssetBundle Current { get; set; }
Property Value
Initialized
public static bool Initialized { get; }
Property Value
Methods
DeleteFile(string)
public abstract void DeleteFile(string path)
Parameters
pathstring
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual void Dispose()
EnumerateFiles(string, string)
Enumerates all files by given path and having the given extension. Order is specific to implementation.
public abstract IEnumerable<string> EnumerateFiles(string path = null, string extension = null)
Parameters
Returns
FileExists(string)
public abstract bool FileExists(string path)
Parameters
pathstring
Returns
FromSystemPath(string)
Translates absolute system file path to the asset path. Raises UnsupportedException() for PackedAssetBundle.
public abstract string FromSystemPath(string systemPath)
Parameters
systemPathstring
Returns
GetFileAttributes(string)
public virtual AssetAttributes GetFileAttributes(string path)
Parameters
pathstring
Returns
GetFileContentsHash(string)
Returns SHA256 based on the file contents.
public abstract SHA256 GetFileContentsHash(string path)
Parameters
pathstring
Returns
GetFileOriginHash(string)
Returns SHA256 that was passed to the ImportFile or ImportFileRaw methods.
public abstract SHA256 GetFileOriginHash(string path)
Parameters
pathstring
Returns
GetFileSize(string)
public abstract int GetFileSize(string path)
Parameters
pathstring
Returns
GetFileUnpackedSize(string)
public abstract int GetFileUnpackedSize(string path)
Parameters
pathstring
Returns
GetLocalizedPath(string)
public string GetLocalizedPath(string path)
Parameters
pathstring
Returns
ImportFile(string, Stream, SHA256, AssetAttributes)
public abstract void ImportFile(string destinationPath, Stream stream, SHA256 originHash, AssetAttributes attributes)
Parameters
destinationPathstringstreamStreamoriginHashSHA256attributesAssetAttributes
ImportFile(string, string, SHA256, AssetAttributes)
public void ImportFile(string sourcePath, string destinationPath, SHA256 originHash, AssetAttributes attributes)
Parameters
sourcePathstringdestinationPathstringoriginHashSHA256attributesAssetAttributes
ImportFileRaw(string, Stream, int, SHA256, SHA256, AssetAttributes)
Imports a file assuming that the input stream is already compressed.
public abstract void ImportFileRaw(string destinationPath, Stream stream, int unpackedSize, SHA256 hash, SHA256 originHash, AssetAttributes attributes)
Parameters
destinationPathstringstreamStreamunpackedSizeinthashSHA256originHashSHA256attributesAssetAttributes
OpenFile(string, FileMode)
public abstract Stream OpenFile(string path, FileMode fileMode = FileMode.Open)
Parameters
Returns
OpenFileLocalized(string)
public Stream OpenFileLocalized(string path)
Parameters
pathstring
Returns
OpenFileRaw(string, FileMode)
Returns file data as it stored in the asset bundle, e.g. compressed.
public abstract Stream OpenFileRaw(string path, FileMode fileMode = FileMode.Open)
Parameters
Returns
ReadAllText(string, Encoding)
public string ReadAllText(string path, Encoding encoding)
Parameters
Returns
ReadFile(string)
public byte[] ReadFile(string path)
Parameters
pathstring
Returns
- byte[]
SetCurrent(AssetBundle, bool)
public static void SetCurrent(AssetBundle bundle, bool resetTexturePool = false)
Parameters
bundleAssetBundleresetTexturePoolbool
ToSystemPath(string)
Translates bundle path to the asset in the file system. Raises UnsupportedException() for PackedAssetBundle.
public abstract string ToSystemPath(string bundlePath)
Parameters
bundlePathstring