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
path
string
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
path
string
Returns
FromSystemPath(string)
Translates absolute system file path to the asset path. Raises UnsupportedException() for PackedAssetBundle.
public abstract string FromSystemPath(string systemPath)
Parameters
systemPath
string
Returns
GetFileAttributes(string)
public virtual AssetAttributes GetFileAttributes(string path)
Parameters
path
string
Returns
GetFileContentsHash(string)
Returns SHA256 based on the file contents.
public abstract SHA256 GetFileContentsHash(string path)
Parameters
path
string
Returns
GetFileOriginHash(string)
Returns SHA256 that was passed to the ImportFile or ImportFileRaw methods.
public abstract SHA256 GetFileOriginHash(string path)
Parameters
path
string
Returns
GetFileSize(string)
public abstract int GetFileSize(string path)
Parameters
path
string
Returns
GetFileUnpackedSize(string)
public abstract int GetFileUnpackedSize(string path)
Parameters
path
string
Returns
GetLocalizedPath(string)
public string GetLocalizedPath(string path)
Parameters
path
string
Returns
ImportFile(string, Stream, SHA256, AssetAttributes)
public abstract void ImportFile(string destinationPath, Stream stream, SHA256 originHash, AssetAttributes attributes)
Parameters
destinationPath
stringstream
StreamoriginHash
SHA256attributes
AssetAttributes
ImportFile(string, string, SHA256, AssetAttributes)
public void ImportFile(string sourcePath, string destinationPath, SHA256 originHash, AssetAttributes attributes)
Parameters
sourcePath
stringdestinationPath
stringoriginHash
SHA256attributes
AssetAttributes
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
destinationPath
stringstream
StreamunpackedSize
inthash
SHA256originHash
SHA256attributes
AssetAttributes
OpenFile(string, FileMode)
public abstract Stream OpenFile(string path, FileMode fileMode = FileMode.Open)
Parameters
Returns
OpenFileLocalized(string)
public Stream OpenFileLocalized(string path)
Parameters
path
string
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
path
string
Returns
- byte[]
SetCurrent(AssetBundle, bool)
public static void SetCurrent(AssetBundle bundle, bool resetTexturePool = false)
Parameters
bundle
AssetBundleresetTexturePool
bool
ToSystemPath(string)
Translates bundle path to the asset in the file system. Raises UnsupportedException() for PackedAssetBundle.
public abstract string ToSystemPath(string bundlePath)
Parameters
bundlePath
string