Example #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="asset"></param>
    private void DestroyAsset(AssetWrapper asset)
    {
        string assetPath = asset.GetAssetPath();

        string[] dps        = asset.GetDps();
        string   mainBundle = asset.GetBundleName();

        if (m_bundleCache.ContainsKey(mainBundle))
        {
            m_bundleCache[mainBundle].DecRefAsset(assetPath);
            if (dps != null)
            {
                for (int i = 0; i < dps.Length; ++i)
                {
                    string dep_name = dps[i];
                    if (m_bundleCache.ContainsKey(dep_name))
                    {
                        m_bundleCache[dep_name].DecRefAsset(assetPath);
                    }
                }
            }
        }
        else
        {
            Debugger.LogWarning("AssetWrapper :" + assetPath + " has no bundle:" + mainBundle + " in m_bundleCache");
        }
    }
Example #2
0
    // 閿€姣佽祫婧徧
    void DestroyAsset(AssetWrapper asset)
    {
        string assetPath = asset.GetAssetPath();

        string[] dps        = asset.GetDps();
        string   mainBundle = asset.GetBundleName();

        if (m_bundleCache.ContainsKey(mainBundle))
        {
            m_bundleCache[mainBundle].DecRefAsset(assetPath);
            if (dps != null)
            {
                for (int i = 0; i < dps.Length; i++)
                {
                    string dep_name = dps[i];
                    if (m_bundleCache.ContainsKey(dep_name))
                    {
                        m_bundleCache[dep_name].DecRefAsset(assetPath);
                    }
                }
            }
        }
        else
        {
            Debug.LogWarning("AssetWrapper :" + assetPath + " has no bundle:" + mainBundle + " in m_bundleCache");
        }
        //鑰冭檻姣忚繃涓€娈垫椂闂村垽鏂?繖浜汢undles鏄?惁宸茬粡娌℃湁琚?娇鐢?紝鐒跺悗鐩存帴閲婃斁
        //m_bundleCache.Remove();
    }