コード例 #1
0
        protected override bool OnUnloadAssetsUpdate()
        {
            bool isFinished = true;
            var  keys       = bundleNodeDic.Keys;

            foreach (var key in keys)
            {
                BundleNode node = bundleNodeDic[key];
                if (!node.IsInUsing())
                {
                    isFinished = false;

                    bundleNodeDic.Remove(key);
                    bundleNodePool.Release(node);
                }
            }

            return(isFinished);
        }
コード例 #2
0
        private void TryToReleaseBundleNode(string bundlePath)
        {
            if (!bundleNodeDic.TryGetValue(bundlePath, out var bundleNode))
            {
                return;
            }
            bundleNode.ReleaseRef();
            if (!bundleNode.IsInUsing())
            {
                bundleNodeDic.Remove(bundlePath);
                bundleNodePool.Release(bundleNode);

                string[] dependBundlePaths = bundleDetailConfig.GetDependencies(bundlePath);
                foreach (var dbp in dependBundlePaths)
                {
                    BundleNode dependBundleNode = bundleNodeDic[dbp];
                    if (!dependBundleNode.IsInUsing())
                    {
                        bundleNodeDic.Remove(bundlePath);
                        bundleNodePool.Release(bundleNode);
                    }
                }
            }
        }