Table of Contents

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

AssetBundle

Initialized

public static bool Initialized { get; }

Property Value

bool

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

path string
extension string

Returns

IEnumerable<string>

FileExists(string)

public abstract bool FileExists(string path)

Parameters

path string

Returns

bool

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

string

GetFileAttributes(string)

public virtual AssetAttributes GetFileAttributes(string path)

Parameters

path string

Returns

AssetAttributes

GetFileContentsHash(string)

Returns SHA256 based on the file contents.

public abstract SHA256 GetFileContentsHash(string path)

Parameters

path string

Returns

SHA256

GetFileOriginHash(string)

Returns SHA256 that was passed to the ImportFile or ImportFileRaw methods.

public abstract SHA256 GetFileOriginHash(string path)

Parameters

path string

Returns

SHA256

GetFileSize(string)

public abstract int GetFileSize(string path)

Parameters

path string

Returns

int

GetFileUnpackedSize(string)

public abstract int GetFileUnpackedSize(string path)

Parameters

path string

Returns

int

GetLocalizedPath(string)

public string GetLocalizedPath(string path)

Parameters

path string

Returns

string

ImportFile(string, Stream, SHA256, AssetAttributes)

public abstract void ImportFile(string destinationPath, Stream stream, SHA256 originHash, AssetAttributes attributes)

Parameters

destinationPath string
stream Stream
originHash SHA256
attributes AssetAttributes

ImportFile(string, string, SHA256, AssetAttributes)

public void ImportFile(string sourcePath, string destinationPath, SHA256 originHash, AssetAttributes attributes)

Parameters

sourcePath string
destinationPath string
originHash SHA256
attributes 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 string
stream Stream
unpackedSize int
hash SHA256
originHash SHA256
attributes AssetAttributes

OpenFile(string, FileMode)

public abstract Stream OpenFile(string path, FileMode fileMode = FileMode.Open)

Parameters

path string
fileMode FileMode

Returns

Stream

OpenFileLocalized(string)

public Stream OpenFileLocalized(string path)

Parameters

path string

Returns

Stream

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

path string
fileMode FileMode

Returns

Stream

ReadAllText(string, Encoding)

public string ReadAllText(string path, Encoding encoding)

Parameters

path string
encoding Encoding

Returns

string

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 AssetBundle
resetTexturePool 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

Returns

string