Beispiel #1
0
 private void GetByteResOnFinish(NetAssurer assurer, Action <byte[]> callback)
 {
     if (callback == null)
     {
         return;
     }
     if (assurer == null)
     {
         callback(null);
     }
     callback(assurer.Get());
 }
Beispiel #2
0
 private void GetResOnFinish <T>(NetAssurer assurer, Action <T> callback) where T : UnityEngine.Object
 {
     if (callback == null)
     {
         return;
     }
     if (assurer == null)
     {
         callback(null);
     }
     callback(assurer.Get <T>());
 }
Beispiel #3
0
        ///<param name="bUnloadTag">释放模式</param>
        ///<param name="bSave">下载完成后是否保存</param>
        ///<param name="bLocalFirst">是否先加载本地</param>
        private NetAssurer GetAssurer(string Url, Type AssetType, bool bUnloadTag = false, bool bSave = false, bool bLocalFirst = false)
        {
            NetAssurer assurer = null;

            if (mAssurerList.ContainsKey(Url))
            {
                assurer = mAssurerList[Url] as NetAssurer;
                assurer.Init(Url, AssetType, bUnloadTag, bSave, bLocalFirst);
            }
            if (assurer == null)
            {
                assurer = NetAssurer.EasyGet();
                MarkAssurer(assurer);
                assurer.Init(Url, AssetType, bUnloadTag, bSave, bLocalFirst);
                mAssurerList.Add(assurer.AssetPath, assurer);
            }
            assurer.Retain();
            Log.IColor("NetAssurer[AssetPath:{0}]", LogColor.Blue, assurer.AssetPath);
            return(assurer);
        }