private void Start() { Debug.Log("开始 ABFramework 测试"); // 调用AB包(连锁智能调用AB包) StartCoroutine(AssetBundleMgr.Instance().LoadAssetBundle(sceneName, abName, LoadALLABComplete)); }
private void Update() { if (Input.GetKeyDown(KeyCode.A)) { Debug.Log("测试销毁资源"); AssetBundleMgr.Instance().DisposeAllAsset(sceneName); } }
public static AssetBundleMgr Instance() { if (instance == null) { instance = new GameObject("AssetBundleMgr").AddComponent <AssetBundleMgr>(); } return(instance); }
private void LoadALLABComplete(string abName) { Debug.Log("所有的AB包都已经加载完毕了"); Object tempObj = AssetBundleMgr.Instance().LoadAsset(sceneName, abName, assetName, false); if (tempObj != null) { Instantiate(tempObj); } }