Exemplo n.º 1
0
        public void Get(RenewableRequest request, Action <RenewableDownloadHandler> success = null, Action fail = null)
        {
            if (string.IsNullOrEmpty(request.key))
            {
                return;
            }

            if (m_task.ContainsKey(request.key))
            {
                m_task[request.key].AddListener(success, fail);
            }
            else
            {
                url = string.Format("{0}{1}", GameConfig.Server_Resource, request.key);

                path = string.Format("{0}/{1}", Application.persistentDataPath, request.key);

                m_task.Add(request.key, new Task(request, url, path)
                {
                    status = TaskStatus.Ready,
                });
                m_task[request.key].AddListener(success, fail);

                Next();
            }
        }
Exemplo n.º 2
0
            public Task(RenewableRequest request, string url, string path)
            {
                this._key = request.key;

                this._parameter = request.parameter;

                this._url = url;

                this._path = path;

                this._type = request.type;

                this._store = request.store;

                this.order = request.order;

                this.local = File.Exists(path);
            }