Exemple #1
0
        /// <summary>
        /// 将多个资源加载到本地并缓存。
        /// </summary>
        /// <param name="req"></param>
        public void LoadReq(IList <CRequest> req, System.Action <object> onGroup, System.Action <LoadingEventArg> onProgress) //onAllCompleteHandle onAllCompletehandle=null,onProgressHandle onProgresshandle=null
        {
            GroupRequestRecord groupFn = null;

            if (onGroup != null)
            {
                groupFn = GroupRequestRecord.Get();
                groupFn.onGroupComplate = onGroup;
                groupFn.onGroupProgress = onProgress;
            }
            for (int i = 0; i < req.Count; i++)
            {
                AddReqToQueue(req[i], groupFn);
            }

            BeginQueue();
        }
Exemple #2
0
        /// <summary>
        /// 加载luatable里面的request
        /// </summary>
        /// <param name="reqs"></param>
        public void LoadLuaTable(LuaTable reqs, System.Action <object> groupCompleteFn, System.Action <LoadingEventArg> groupProgressFn)
        {
            GroupRequestRecord re = null;

            if (groupCompleteFn != null)
            {
                re = GroupRequestRecord.Get();
                re.onGroupComplate = groupCompleteFn;
                re.onGroupProgress = groupProgressFn;
            }

            foreach (var pair in reqs)
            {
                AddReqToQueue((CRequest)pair.value, re);
            }

            BeginQueue();
        }