private void render()
        {
            int len = handlerList.Count;

            tempHandle.Clear();

            float currentTime = Time.time;

            for (int i = len - 1; i > -1; i--)
            {
                if (currentTime > timeList[i])
                {
                    tempHandle.Add(handlerList[i]);
                    handlerList.RemoveAt(i);
                    timeList.RemoveAt(i);
                }
            }

            len = tempHandle.Count;
            for (int i = len - 1; i > -1; i--)
            {
                tempHandle[i]();
            }

            if (handlerList.Count == 0)
            {
                TickManager.remove(render);
            }
        }
        private void _forceAll()
        {
            foreach (IAutoReleaseRef res in pool.Keys)
            {
                res.__dispose();
            }
            pool.Clear();

            isRunning = false;
            TickManager.remove(tick);
        }
        protected override IEnumerator doLoad()
        {
            www = new WWW(formatedURL(url));

            if (checkProgress)
            {
                TickManager.add(progress);
            }
            yield return(www);

            if (checkProgress)
            {
                TickManager.remove(progress);
            }

            if (www == null)
            {
                _state = AssetState.FAILD;
                _data  = null;
                string message = string.Format("加载文件失败:{0} 已被dispose", url);
                DebugX.Log(message);
                this.dispatchEvent(new EventX(EventX.FAILED, message));
            }
            else
            {
                if (string.IsNullOrEmpty(www.error))
                {
//                    if (www.isDone)
//                    {
                    _state = AssetState.READY;
                    _data  = www.bytes;
                    this.simpleDispatch(EventX.COMPLETE, _data);
                    //                   }
//                    else
//                    {
//                        _state = AssetState.FAILD;
//                        _data = null;
//                        string message = string.Format("加载文件失败:{0} 没有完成", url);
//                        DebugX.Log(message);
//                        this.dispatchEvent(new EventX(EventX.FAILED, message));
//                    }
                }
                else
                {
                    _state = AssetState.FAILD;
                    _data  = null;
                    string message = string.Format("加载文件失败:{0} error:{1}", url, www.error);
                    DebugX.LogWarning(message);
                    this.simpleDispatch(EventX.FAILED, message);
                }
            }
        }
        public static bool remove(Action <int> value)
        {
            if (set.ContainsKey(value))
            {
                set.Remove(value);
            }

            if (set.Count == 0)
            {
                pre = DateTime.MinValue;
                TickManager.remove(tick);
            }

            return(true);
        }
        private void tick()
        {
            if ((timeCount += Time.deltaTime) < 3000)
            {
                return;
            }

            timeCount = 0;
            long now   = DateTime.Now.Ticks;
            int  total = 0;

            List <IAutoReleaseRef> clearList = new List <IAutoReleaseRef>();

            foreach (IAutoReleaseRef res in pool.Keys)
            {
                total++;
                if (now - pool[res] > TIMEOUT)
                {
                    clearList.Add(res);
                }
            }


            int len = clearList.Count;

            if (len > 0)
            {
                foreach (IAutoReleaseRef res in clearList)
                {
                    res.__dispose();
                    pool.Remove(res);
                }
            }

            if (total == len)
            {
                isRunning = false;
                TickManager.remove(tick);
            }
        }