Exemplo n.º 1
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static WebRequestResult <byte[]> ToAsyncByteArray(this UnityWebRequest request)
        {
            var result = new WebRequestResult <byte[]>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        /// <returns>Returns a <see cref="IAsyncOperation{TResult}"/> instance that will complete when the source operation have completed.</returns>
        public static WebRequestResult <string> ToAsyncString(this UnityWebRequest request)
        {
            var result = new WebRequestResult <string>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static WebRequestResult <MovieTexture> ToAsyncMovieTexture(this UnityWebRequest request)
        {
            var result = new WebRequestResult <MovieTexture>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static WebRequestResult <AudioClip> ToAsyncAudioClip(this UnityWebRequest request)
        {
            var result = new WebRequestResult <AudioClip>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static WebRequestResult <AssetBundle> ToAsyncAssetBundle(this UnityWebRequest request)
        {
            var result = new WebRequestResult <AssetBundle>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation{TResult}"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static WebRequestResult <T> ToAsync <T>(this UnityWebRequest request) where T : class
        {
            var result = new WebRequestResult <T>(request);

            result.Start();
            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Creates an <see cref="IAsyncOperation"/> wrapper for the specified <see cref="UnityWebRequest"/>.
        /// </summary>
        /// <param name="request">The source web request.</param>
        public static AsyncResult ToAsync(this UnityWebRequest request)
        {
            var result = new WebRequestResult <object>(request);

            result.Start();
            return(result);
        }