/// <summary>
 /// 根据资源类型获取服务器地址
 /// </summary>
 /// <param name="assetEum"></param>
 /// <returns></returns>
 public HotAssetServerAddressInfor GetHotAssetServerAddressInforByType(HotAssetEnum assetEum)
 {
     foreach (var item in m_AllHotAssetServerInfor)
     {
         if (assetEum == item.m_AssetEum)
         {
             return(item);
         }
     }
     Debug.LogError("没有定义热更新资源服务器地址:" + assetEum);
     return(null);
 }
Esempio n. 2
0
        protected override void InitialSingleton()
        {
            base.InitialSingleton();
            IsUpdatingAsset         = IsUpdateError = false;
            S_IsCompleteUpdateAsset = false;

            var assetEnum = System.Enum.GetValues(typeof(HotAssetEnum));

            foreach (var item in assetEnum)
            {
                HotAssetEnum hotAsset = (HotAssetEnum)System.Enum.Parse(typeof(HotAssetEnum), item.ToString());
                m_AllAssetUpdateManagers.Add(hotAsset, AssetUpdateManagerFactory.CreateUpdateMgr(hotAsset));
            }
        }
        /// <summary>
        /// 根据不同的资源类型获取对用的资源工厂
        /// </summary>
        /// <param name="assetEnum"></param>
        /// <returns></returns>
        public static AssetUpdateManagerBase CreateUpdateMgr(HotAssetEnum assetEnum)
        {
            switch (assetEnum)
            {
            case HotAssetEnum.AssetBundleAsset:
                return(new AsssetBundleUpdateManager());

            case HotAssetEnum.LuaAsset:
                Debug.LogError("没有处理Lua  TODO");
                return(null);

            default:
                Debug.LogError("没有处理定义的资源类型 " + assetEnum);
                return(null);
            }
        }