Example #1
0
        public void ReadFileStr(string noticeKey, string fileUrl, float timeoutSec, WWWUrlRstDel del, LuaFunction lua)
        {
            mType      = WWWType.read;
            mUrlRstDel = del;
            setLuaCallback(lua);
            mTimeoutSec = timeoutSec;
            NoticeKey   = noticeKey;

            mList.Clear();
            mList.Add(new WWWInfo(fileUrl, ""));
        }
Example #2
0
        /// <summary>
        /// 请求某个链接,并获取其返回值或错误信息
        /// </summary>
        /// <param name="url">请求地址</param>
        /// <param name="timeoutSec">超时时间(秒)</param>
        /// <param name="del">请求回调:
        /// (bool rst, string msg)
        /// rst 表示请求是否成功,msg信息(成返回结果,失败返回错误信息)
        /// </param>
        /// <param name="lua">lua回调,参数跟del相同</param>
        public void RequestUrl(string url, float timeoutSec, WWWUrlRstDel del, LuaFunction lua)
        {
            mType      = WWWType.request;
            mUrlRstDel = del;
            setLuaCallback(lua);
            mTimeoutSec = timeoutSec;

            mList.Add(new WWWInfo()
            {
                Url = url,
            });
        }
Example #3
0
        public static WWWTO ReadFileStr(string fileUrl, WWWUrlRstDel del, LuaFunction lua)
        {
            WWWTO www = new WWWTO();

            www.mType      = WWWType.read;
            www.mUrlRstDel = del;
            www._setLuaCallback(lua);

            www.mList.Clear();
            www.mList.Add(new WWWInfo(fileUrl, ""));

            return(www);
        }
Example #4
0
        /// <summary>
        /// 请求某个链接,并获取其返回值或错误信息
        /// </summary>
        /// <param name="url">请求地址</param>
        /// <param name="del">请求回调:
        /// (bool rst, string msg)
        /// rst 表示请求是否成功,msg信息(成返回结果,失败返回错误信息)
        /// </param>
        /// <param name="lua">lua回调,参数跟del相同</param>
        public static WWWTO RequestUrl(string url, WWWUrlRstDel del, LuaFunction lua)
        {
            WWWTO www = new WWWTO();

            www.mType      = WWWType.request;
            www.mUrlRstDel = del;
            www._setLuaCallback(lua);

            www.mList.Add(new WWWInfo()
            {
                Url = url,
            });
            return(www);
        }
Example #5
0
        public void ReadFirstExistsStr(string noticeKey, List <string> files, float timeoutSec, WWWUrlRstDel del, LuaFunction lua)
        {
            mType      = WWWType.read;
            mUrlRstDel = del;
            setLuaCallback(lua);
            mTimeoutSec = timeoutSec;
            NoticeKey   = noticeKey;

            mList.Clear();
            for (int i = 0; i < files.Count; i++)
            {
                string fileUrl = files[i];
                mList.Add(new WWWInfo(fileUrl, ""));
            }
        }
Example #6
0
        public static WWWTO ReadFirstExistsStr(List <string> files, WWWUrlRstDel del, LuaFunction lua)
        {
            WWWTO www = new WWWTO();

            www.mType      = WWWType.read;
            www.mUrlRstDel = del;
            www._setLuaCallback(lua);

            www.mList.Clear();
            for (int i = 0; i < files.Count; i++)
            {
                string fileUrl = files[i];
                www.mList.Add(new WWWInfo(fileUrl, ""));
            }

            return(www);
        }