コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
                }
            }
        }