コード例 #1
0
        /// <summary>
        /// 通过一个路径加载ab
        /// </summary>
        /// <param name="path">路径</param>
        /// <param name="prority">优先级</param>
        /// <param name="handler">回调</param>
        /// <returns></returns>
        public AssetBundleLoader Load(string path, int prority, LoadAssetCompleteHandler handler = null)
        {
#if _AB_MODE_
            AssetBundleLoader loader = this.CreateLoader(HashUtil.Get(path.ToLower()) + ".ab", path);
#else
            AssetBundleLoader loader = this.CreateLoader(path);
#endif
            loader.prority     = prority;
            loader.onComplete += handler;

            _isCurrentLoading = true;
            _nonCompleteLoaderSet.Add(loader);
            _thisTimeLoaderSet.Add(loader);

            return(loader);
        }
コード例 #2
0
        public AssetBundleInfo GetBundleInfo(string key)
        {
            key = key.ToLower();
#if _AB_MODE_
            key = HashUtil.Get(key) + ".ab";
#endif
            var e = _loadedAssetBundle.GetEnumerator();
            while (e.MoveNext())
            {
                AssetBundleInfo abi = e.Current.Value;
                if (abi.bundleName == key)
                {
                    return(abi);
                }
            }
            return(null);
        }