Table of Contents

Class WrappedAssetBundle

Namespace
S1API.AssetBundles
Assembly
S1API.dll

INTERNAL: Wrapper around UnityEngine.AssetBundle instance.

public class WrappedAssetBundle
Inheritance
WrappedAssetBundle
Inherited Members
Extension Methods

Constructors

WrappedAssetBundle(AssetBundle)

Initializes a new instance of the WrappedAssetBundle class.

public WrappedAssetBundle(AssetBundle realBundle)

Parameters

realBundle AssetBundle

The actual Unity AssetBundle to wrap.

Properties

IsStreamedAssetBundle

Gets a value indicating whether this asset bundle is a streamed scene asset bundle.

public bool IsStreamedAssetBundle { get; }

Property Value

bool

Methods

Contains(string)

Checks if the asset bundle contains a specific asset by name.

public bool Contains(string name)

Parameters

name string

Returns

bool

GetAllAssetNames()

Returns all asset names contained in the asset bundle.

public string[] GetAllAssetNames()

Returns

string[]

GetAllScenePaths()

Returns all scene paths contained in the asset bundle.

public string[] GetAllScenePaths()

Returns

string[]

Load(string)

Loads an asset by name as a generic UnityEngine.Object.

public Object Load(string name)

Parameters

name string

Returns

Object

Load(string, Type)

Loads an asset by name using a Type object.

public Object Load(string name, Type type)

Parameters

name string
type Type

Returns

Object

LoadAll()

Loads all assets from the bundle as UnityEngine.Object instances.

public Object[] LoadAll()

Returns

Object[]

LoadAllAssets()

Loads all assets from the bundle as UnityEngine.Object instances.

public Object[] LoadAllAssets()

Returns

Object[]

LoadAllAssets(Type)

Loads all assets from the bundle using a Type object.

public Object[] LoadAllAssets(Type type)

Parameters

type Type

Returns

Object[]

LoadAllAssets<T>()

Loads all assets from the bundle and casts them to the specified type.

public T[] LoadAllAssets<T>() where T : Object

Returns

T[]

Type Parameters

T

LoadAsset(string)

Loads an asset by name as a generic UnityEngine.Object.

public Object LoadAsset(string name)

Parameters

name string

Returns

Object

LoadAsset(string, Type)

Loads an asset by name using a Type object.

public Object LoadAsset(string name, Type type)

Parameters

name string
type Type

Returns

Object

LoadAssetAsync(string)

Asynchronously loads an asset by name as a generic UnityEngine.Object.

public WrappedAssetBundleRequest LoadAssetAsync(string name)

Parameters

name string

Returns

WrappedAssetBundleRequest

LoadAssetAsync(string, Type)

Asynchronously loads an asset by name using a Type object.

public WrappedAssetBundleRequest LoadAssetAsync(string name, Type type)

Parameters

name string
type Type

Returns

WrappedAssetBundleRequest

LoadAssetAsync<T>(string)

Asynchronously loads an asset by name and casts it to the specified type.

public WrappedAssetBundleRequest LoadAssetAsync<T>(string name) where T : Object

Parameters

name string

Returns

WrappedAssetBundleRequest

Type Parameters

T

LoadAssetWithSubAssets(string)

Loads an asset and all of its sub-assets by name as UnityEngine.Object instances.

public Object[] LoadAssetWithSubAssets(string name)

Parameters

name string

Returns

Object[]

LoadAssetWithSubAssets(string, Type)

Loads an asset and its sub-assets by name using a Type object.

public Object[] LoadAssetWithSubAssets(string name, Type type)

Parameters

name string
type Type

Returns

Object[]

LoadAssetWithSubAssets<T>(string)

Loads an asset and its sub-assets by name and casts them to the specified type.

public T[] LoadAssetWithSubAssets<T>(string name) where T : Object

Parameters

name string

Returns

T[]

Type Parameters

T

LoadAsset<T>(string)

Loads an asset by name and casts it to the specified type.

public T LoadAsset<T>(string name) where T : Object

Parameters

name string

Returns

T

Type Parameters

T

Load<T>(string)

Loads an asset by name and casts it to the specified type.

public T Load<T>(string name) where T : Object

Parameters

name string

Returns

T

Type Parameters

T

Unload(bool)

Unloads the asset bundle and optionally unloads all loaded objects.

public void Unload(bool unloadAllLoadedObjects)

Parameters

unloadAllLoadedObjects bool

Whether to unload all loaded objects as well.