//----------------------------------------------------------------------------------------------------------------// /// <summary> /// 加载器 /// </summary> /// <param name="url">远程地址</param> /// <param name="version">如果version>=0则表示要缓存本地,同时如果本地以及存在相应版本或更高版本则从本地加载</param> protected UrlLoader(DownLoadAgent config) { this.attempts = defaultAttempts; onLoadStart = new Signal <ILoader>(); onLoadComplete = new Signal <ILoader>(); onLoadError = new Signal <ILoader>(); onUnloadLocalStart = new Signal <ILoader>(); onUnloadLocalComplete = new Signal <ILoader>(); onUnloadLocalError = new Signal <ILoader>(); this.config = config; }
public PictureLoader(DownLoadAgent config) : base(config) { switch (config.cacheType) { case DownLoadAgent.LocalCacheType.File: _localCache = new LcTexture2DFile(cacheName); break; case DownLoadAgent.LocalCacheType.PlayerPrefs: DebugConsole.Error("Loader", "TextureLoader", "不能选择PlayerPrefs"); break; case DownLoadAgent.LocalCacheType.Memory: _localCache = new LcMemory <Texture2D>(cacheName); break; } }
public BytesLoader(DownLoadAgent config) : base(config) { switch (config.cacheType) { case DownLoadAgent.LocalCacheType.File: _localCache = new LcBytesFile(cacheName); break; case DownLoadAgent.LocalCacheType.PlayerPrefs: _localCache = new LcBytes(cacheName); break; case DownLoadAgent.LocalCacheType.Memory: _localCache = new LcMemory <byte[]>(cacheName); break; } }
public TextLoader(DownLoadAgent config) : base(config) { switch (config.cacheType) { case DownLoadAgent.LocalCacheType.File: _localCache = new LcStringFile(cacheName); break; case DownLoadAgent.LocalCacheType.PlayerPrefs: _localCache = new LcString(cacheName); break; case DownLoadAgent.LocalCacheType.Memory: _localCache = new LcMemory <string>(cacheName); break; } }
public static T GetLoader <T>(DownLoadAgent config) where T : UrlLoader { UrlLoader loader = null; if (Loaders.TryGetValue(config.GUID, out loader)) { if (loader is T) { return(loader as T); } else { DebugConsole.Warning("LoaderFactory", "GetLoader", "同一个资源文件被不同的类型请求"); return(null); } } loader = ReflecTool.Instantiate <T>(new Type[] { typeof(DownLoadAgent) }, new object[] { config }); Loaders[config.GUID] = loader; return(loader as T); }
public UnityResourceLoader(DownLoadAgent config) : base(config) { }
protected LocalVersionEnableLoader(DownLoadAgent config) : base(config) { }
public MovLoader(DownLoadAgent config) : base(config) { }
public AssetBundleLoader(DownLoadAgent config) : base(config) { }