C# Class Tangzx.ABSystem.AssetBundleManager

Inheritance: UnityEngine.MonoBehaviour
Show file Open project: tangzx/ABSystem Class Usage Examples

Public Properties

Property Type Description
Instance AssetBundleManager
NAME string
enableLog bool
onProgress LoadProgressHandler
pathResolver AssetBundlePathResolver
version System.Version

Public Methods

Method Description
AssetBundleManager ( ) : System
GetAssetBundleFullName ( string shortFileName ) : string

通过ShortName获取FullName

GetBundleInfo ( string key ) : AssetBundleInfo
Init ( System.Action callback ) : void
Init ( Stream depStream, System.Action callback ) : void
Load ( string path, LoadAssetCompleteHandler handler = null ) : AssetBundleLoader

用默认优先级为0的值加载

Load ( string path, int prority, LoadAssetCompleteHandler handler = null ) : AssetBundleLoader

通过一个路径加载ab

RemoveAll ( ) : void
RemoveBundle ( string key ) : void
UnloadUnusedBundle ( bool force = false ) : void

卸载不用的

Protected Methods

Method Description
Awake ( ) : void
CreateLoader ( ) : AssetBundleLoader

Private Methods

Method Description
CheckNewLoaders ( ) : void
CheckQueue ( ) : void
CheckUnusedBundle ( ) : void
CreateBundleInfo ( AssetBundleLoader loader, AssetBundleInfo abi = null, AssetBundle assetBundle = null ) : AssetBundleInfo
CreateLoader ( string abFileName, string oriName = null ) : AssetBundleLoader
Enqueue ( AssetBundleLoader loader ) : void

请求加载Bundle,这里统一分配加载时机,防止加载太卡

InitComplete ( ) : void
LoadBundle ( AssetBundleLoader loader ) : void
LoadComplete ( AssetBundleLoader loader ) : void
LoadDepInfo ( ) : IEnumerator
LoadError ( AssetBundleLoader loader ) : void
OnDestroy ( ) : void
RemoveBundleInfo ( AssetBundleInfo abi ) : void
Update ( ) : void

Method Details

AssetBundleManager() public method

public AssetBundleManager ( ) : System
return System

Awake() protected method

protected Awake ( ) : void
return void

CreateLoader() protected method

protected CreateLoader ( ) : AssetBundleLoader
return AssetBundleLoader

GetAssetBundleFullName() public method

通过ShortName获取FullName
public GetAssetBundleFullName ( string shortFileName ) : string
shortFileName string
return string

GetBundleInfo() public method

public GetBundleInfo ( string key ) : AssetBundleInfo
key string
return AssetBundleInfo

Init() public method

public Init ( System.Action callback ) : void
callback System.Action
return void

Init() public method

public Init ( Stream depStream, System.Action callback ) : void
depStream Stream
callback System.Action
return void

Load() public method

用默认优先级为0的值加载
public Load ( string path, LoadAssetCompleteHandler handler = null ) : AssetBundleLoader
path string 路径
handler LoadAssetCompleteHandler 回调
return AssetBundleLoader

Load() public method

通过一个路径加载ab
public Load ( string path, int prority, LoadAssetCompleteHandler handler = null ) : AssetBundleLoader
path string 路径
prority int 优先级
handler LoadAssetCompleteHandler 回调
return AssetBundleLoader

RemoveAll() public method

public RemoveAll ( ) : void
return void

RemoveBundle() public method

public RemoveBundle ( string key ) : void
key string
return void

UnloadUnusedBundle() public method

卸载不用的
public UnloadUnusedBundle ( bool force = false ) : void
force bool
return void

Property Details

Instance public static property

public static AssetBundleManager,Tangzx.ABSystem Instance
return AssetBundleManager

NAME public static property

public static string NAME
return string

enableLog public static property

public static bool enableLog
return bool

onProgress public property

进度
public LoadProgressHandler onProgress
return LoadProgressHandler

pathResolver public property

public AssetBundlePathResolver,Tangzx.ABSystem pathResolver
return AssetBundlePathResolver

version public static property

public static Version,System version
return System.Version