Exemple #1
0
        public ResourceAssetBundleRequester GetAssetBundleAsyncCreater(string assetbundleName)
        {
            ResourceAssetBundleRequester creater = null;

            assetbundleRequesting.TryGetValue(assetbundleName, out creater);
            return(creater);
        }
Exemple #2
0
        // 本地异步请求单独Assetbundle资源,不计引用计数、不缓存,Creater使用后记得回收
        public ResourceAssetBundleRequester RequestAssetBundleAsync(string assetbundleName)
        {
            var creater = ResourceAssetBundleRequester.Get();
            var url     = AssetBundleUtility.GetAssetBundleFileUrl(assetbundleName);

            creater.Init(assetbundleName, url, true);
            assetbundleRequesting.Add(assetbundleName, creater);
            assetbundleRequesterQueue.Enqueue(creater);
            return(creater);
        }
Exemple #3
0
        private bool CreateAssetBundleAsync(string assetbundleName)
        {
            if (IsAssetBundleLoaded(assetbundleName) || assetbundleRequesting.ContainsKey(assetbundleName))
            {
                return(false);
            }

            var creater = ResourceAssetBundleRequester.Get();
            var url     = AssetBundleUtility.GetAssetBundleFileUrl(assetbundleName);

            creater.Init(assetbundleName, url);
            assetbundleRequesting.Add(assetbundleName, creater);
            assetbundleRequesterQueue.Enqueue(creater);

            return(true);
        }
Exemple #4
0
 public static void Recycle(ResourceAssetBundleRequester creater)
 {
     pool.Enqueue(creater);
 }