示例#1
0
        public static async Task <LoaderRequest> Load(string rURL)
        {
            LoaderRequest rRequest    = new LoaderRequest(rURL);
            string        rVersionURL = rRequest.Url;

            WWWAssist.LoaderRequest rWWWVersionRequest = await WWWAssist.LoadFile(rVersionURL);

            if (rWWWVersionRequest.Bytes == null || rWWWVersionRequest.Bytes.Length == 0)
            {
                return(null);
            }

            ABVersion rVersion = new ABVersion();

            using (var ms = new MemoryStream(rWWWVersionRequest.Bytes))
            {
                using (var br = new BinaryReader(ms))
                {
                    rVersion.Deserialize(br);
                }
            }
            rRequest.Version = rVersion;

            return(rRequest);
        }
示例#2
0
        private static IEnumerator Load_Async(LoaderRequest rRequest)
        {
            string rVersionURL = rRequest.Url;

            WWWAssist.LoaderRequest rWWWVersionRequest = WWWAssist.LoadFile(rVersionURL);
            yield return(rWWWVersionRequest);

            if (rWWWVersionRequest.Bytes == null || rWWWVersionRequest.Bytes.Length == 0)
            {
                yield break;
            }

            ABVersion rVersion = new ABVersion();

            using (var ms = new MemoryStream(rWWWVersionRequest.Bytes))
            {
                using (var br = new BinaryReader(ms))
                {
                    rVersion.Deserialize(br);
                }
            }
            rRequest.Version = rVersion;
        }