private void _UnloadAssetBundleDataWithDepend(int bundleId) { AssetBundleData bundleData = null; if (!m_assetBundleDict.TryGetValue(bundleId, out bundleData)) { return; } int cur = ResourceMainfest.GetDependFirst(bundleId); while (cur != -1) { int depBundleId = ResourceMainfest.GetDependValue(cur); cur = ResourceMainfest.GetDependNext(cur); AssetBundleData depBundle = null; m_assetBundleDict.TryGetValue(depBundleId, out depBundle); if (depBundle != null) { depBundle.Release(); } } bundleData.Release(); if (bundleData.Unloadable()) { _UnloadBundleData(bundleData); } }
private AssetBundleData _LoadAssetBundleDataWithDepend(int bundleId) { int cur = ResourceMainfest.GetDependFirst(bundleId); while (cur != -1) { int depBundleId = ResourceMainfest.GetDependValue(cur); cur = ResourceMainfest.GetDependNext(cur); _LoadAssetBundleData(depBundleId); } return(_LoadAssetBundleData(bundleId)); }
private void _UpdateBundleRef(int bundleId, bool addRef) { AssetBundleData bundleData = null; if (m_assetBundleDict.TryGetValue(bundleId, out bundleData)) { _UpdateBundleDataRef(bundleData, addRef); } int cur = ResourceMainfest.GetDependFirst(bundleId); while (cur != -1) { int value = ResourceMainfest.GetDependValue(cur); cur = ResourceMainfest.GetDependNext(cur); if (m_assetBundleDict.TryGetValue(value, out bundleData)) { _UpdateBundleDataRef(bundleData, addRef); } } }