private void Update() { if (Input.GetKeyDown(KeyCode.A)) { AssetBundleMgr.GetInstance().DisposeAllAssets(_SceneName); } }
//测试销毁资源 private void Update() { if (Input.GetKeyDown(KeyCode.A)) { Debug.Log(GetType() + " 测试销毁资源"); AssetBundleMgr.GetInstance().DisposeAllAssets(_ScenesName); } }
private void LoadAllABComplete(string abName) { UnityEngine.Object tmpObj = null; tmpObj = (UnityEngine.Object)AssetBundleMgr.GetInstance().LoadAsset(_SceneName, _AssetBundleName, _AssetName, false); Debug.Log(tmpObj); if (tmpObj != null) { Instantiate(tmpObj); } }
//回调函数: 所有的AB包都已经加载完毕了 private void LoadAllABComplete(string abName) { Debug.Log(GetType() + "所有的AB包都已经加载完毕了"); UnityEngine.Object tmpObj = null; //提取资源 tmpObj = (UnityEngine.Object)AssetBundleMgr.GetInstance().LoadAsset(_ScenesName, _AssetBundelName, _AssetName, false); if (tmpObj != null) { Instantiate(tmpObj); } }
private void Start() { StartCoroutine(AssetBundleMgr.GetInstance().LoadAssetBundlePack(_SceneName, _AssetBundleName, LoadAllABComplete)); }
private void Start() { Debug.Log(GetType() + "开始'ABFW'框架测试 "); //调用AB包(连锁智能调用AB包【集合】) StartCoroutine(AssetBundleMgr.GetInstance().LoadAssetBundlePack(_ScenesName, _AssetBundelName, LoadAllABComplete)); }