Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LoadAssetWithSubAssets

Loads Asset and sub Assets from the AssetBundle synchronously.
Read time 2 minutesLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AssetBundleModule

LoadAssetWithSubAssets(string)

Loads Asset and sub Assets from the AssetBundle synchronously.
public Object[] LoadAssetWithSubAssets(string name)

Parameters

name

Name of the Asset.

Returns

Type

Description

Object[]An array of the loaded asset and its sub-assets.

Remarks

Load objects from the Asset and its SubAssets. If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned. An example usage is to load all sprites from an sprite that uses "Multiple" for its Sprite Mode.

LoadAssetWithSubAssets<T>(string)

Loads Asset and sub Assets from the AssetBundle synchronously.
public T[] LoadAssetWithSubAssets<T>(string name) where T : Object

Parameters

name

Name of the Asset.

Returns

Type

Description

<T>[]An array of the loaded asset and its sub-assets of type
T
.

Remarks

Load objects from the Asset and its SubAssets. If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned. An example usage is to load all sprites from an sprite that uses "Multiple" for its Sprite Mode.

LoadAssetWithSubAssets(string, Type)

Loads Asset and sub Assets from the AssetBundle synchronously.
public Object[] LoadAssetWithSubAssets(string name, Type type)

Parameters

name

Name of the Asset.

type

Type to load.

Returns

Type

Description

Object[]An array of the loaded asset and its sub-assets that match the specified type.

Remarks

Load objects from the Asset and its SubAssets. If the signatures that specify the type are called then the requested type is matched against the Main object and Visible objects in each Asset. Otherwise the main objects of each Asset is returned. An example usage is to load all sprites from an sprite that uses "Multiple" for its Sprite Mode.