Exemple #1
0
    public AssetInfo <T> GetAssetCache <T>(string sPath, IAssetLoader loader) where T : UnityEngine.Object
    {
        sPath = sPath.ToLower();
        Cache cache = m_AssetCache.GetCache(sPath);

        if (cache == null)
        {
            if (loader is ABAssetLoader)
            {
                cache = new ABAssetInfo <T>(sPath, m_AssetCache);
            }
            else
            {
                cache = new AssetInfo <T>(sPath, m_AssetCache);
            }
        }
        m_AssetCache.AddCacheToDic(sPath, cache);

        AssetInfo <T> assetInfo = cache as AssetInfo <T>;

        if (assetInfo != null)
        {
            assetInfo.AddRef();
            return(assetInfo);
        }
        else
        {
            return(null);
        }
    }
Exemple #2
0
    public ABInfo GetABCache(string sPath)
    {
        Cache cache = m_ABCache.GetCache(sPath);

        if (cache == null)
        {
            cache = new ABInfo(sPath, m_ABCache);
        }
        m_ABCache.AddCacheToDic(sPath, cache);
        ABInfo abInfo = cache as ABInfo;

        if (abInfo != null)
        {
            abInfo.AddRef();
            return(abInfo);
        }
        else
        {
            return(null);
        }
    }