コード例 #1
0
ファイル: UrlLoader.cs プロジェクト: SeanTongTx/ManicureTools
        //----------------------------------------------------------------------------------------------------------------//
        /// <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;
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
    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);
    }
コード例 #6
0
 public UnityResourceLoader(DownLoadAgent config)
     : base(config)
 {
 }
コード例 #7
0
 protected LocalVersionEnableLoader(DownLoadAgent config) : base(config)
 {
 }
コード例 #8
0
ファイル: MovLoader.cs プロジェクト: SeanTongTx/ManicureTools
 public MovLoader(DownLoadAgent config)
     : base(config)
 {
 }
コード例 #9
0
 public AssetBundleLoader(DownLoadAgent config) : base(config)
 {
 }