Example #1
0
        /// <summary>
        /// 获取或者创建一个缓存
        /// </summary>
        /// <param name="assethashcode"></param>
        /// <returns></returns>
        internal static bool CreateOrGetCache(string abName, out CacheData cache)
        {
            if (!m_Caches.TryGetValue(abName, out cache))
            {
                cache = CacheData.Get();
                CacheData.SetCacheDataAssetBundleName(cache, abName);
                m_Caches.Add(abName, cache);
            }

            return(cache.canUse);
        }
Example #2
0
        /// <summary>
        /// 获取或者创建一个缓存
        /// </summary>
        /// <param name="assethashcode"></param>
        /// <returns></returns>
        internal static bool CreateOrGetCache(int keyhashcode, out CacheData cache)
        {
            if (caches.TryGetValue(keyhashcode, out cache))
            {
            }
            else
            {
                cache = CacheData.Get();
                cache.assetHashCode = keyhashcode;
                caches.Add(keyhashcode, cache);
            }

            return(cache.canUse);
        }
Example #3
0
        internal static bool CreateOrGetCache(string key, out CacheData cache)
        {
            int keyhashcode = LuaHelper.StringToHash(key);

            if (caches.TryGetValue(keyhashcode, out cache))
            {
            }
            else
            {
                cache = CacheData.Get();
                cache.SetCacheData(null, key);
                caches.Add(cache.assetHashCode, cache);
            }

            return(cache.canUse);
        }