public void RemoveNode(SVDoubleLinkedListNode <T> pNode)
    {
        if (pNode == null)
        {
            return;
        }

        if (pNode == Head)
        {
            Head = pNode.next;
        }

        if (pNode == Tail)
        {
            Tail = pNode.prev;
        }

        if (pNode.prev != null)
        {
            pNode.prev.next = pNode.next;
        }

        if (pNode.next != null)
        {
            pNode.next.prev = pNode.prev;
        }

        m_Count--;
        pNode.Reset();
        m_DoubleLinkNodePool.Recycle(pNode);
    }
Exemple #2
0
    private bool UnLoadAssetBundle(string name)
    {
        uint crc = Crc32.GetCrc32(name);

        if (m_AssetBundleItemDic.TryGetValue(crc, out SVAssetBundleItem item) && item != null)
        {
            item.Refcount--;
            if (item.Refcount < 0)
            {
                item.assetBundle.Unload(true);
                item.Reset();
                m_AssetBundleItemDic.Remove(crc);
                m_AssetBundleItemPool.Recycle(item);
                return(true);
            }
        }
        return(false);
    }