private void OnBundleCreated(AAsyncOperation operation) { BundleAsyncOperation bundleOperation = (BundleAsyncOperation)operation; string bundlePath = bundleOperation.Path; if (bundleNodeDic.TryGetValue(bundlePath, out var node)) { node.Bundle = (AssetBundle)bundleOperation.GetAsset(); } bundleOperationDic.Remove(bundlePath); bundleOperationPool.Release(bundleOperation); operationLDic.Remove(bundlePath); }
private BundleNode CreateAsyncBundleNode(string bundlePath) { var bundleNode = bundleNodePool.Get(); bundleNode.State = NodeState.Loading; BundleAsyncOperation bundleOperation = bundleOperationPool.Get(); bundleOperation.DoInitilize(bundlePath, bundleRootDir); bundleOperation.OnOperationComplete = OnBundleCreated; bundleOperationDic.Add(bundlePath, bundleOperation); operationLDic.Add(bundlePath, bundleOperation); bundleNodeDic.Add(bundlePath, bundleNode); return(bundleNode); }