コード例 #1
0
 // T: where T : AsyncOperation is ambigious with IObservable<T>.AsObservable
 public static IObservable <T> AsAsyncOperationObservable <T>(this T asyncOperation, IProgress <float> progress = null)
     where T : AsyncOperation
 {
     return(ObservableUnity.FromCoroutine <T>((observer, cancellation) => AsObservableCore(asyncOperation, observer, progress, cancellation)));
 }
コード例 #2
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
        public static IObservable <WWW> PostWWW(string url, WWWForm content, Hash headers, IProgress <float> progress = null)
        {
            var contentHeaders = content.headers;

            return(ObservableUnity.FromCoroutine <WWW>((observer, cancellation) => Fetch(new WWW(url, content.data, MergeHash(contentHeaders, headers)), observer, progress, cancellation)));
        }
コード例 #3
0
 /// <summary>
 /// If you needs return value, use AsAsyncOperationObservable instead.
 /// </summary>
 public static IObservable <AsyncOperation> AsObservable(this AsyncOperation asyncOperation, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <AsyncOperation>((observer, cancellation) => AsObservableCore(asyncOperation, observer, progress, cancellation)));
 }
コード例 #4
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
 public static IObservable <WWW> PostWWW(string url, WWWForm content, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <WWW>((observer, cancellation) => Fetch(new WWW(url, content), observer, progress, cancellation)));
 }
コード例 #5
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
 public static IObservable <WWW> PostWWW(string url, byte[] postData, Hash headers, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <WWW>((observer, cancellation) => Fetch(new WWW(url, postData, headers), observer, progress, cancellation)));
 }
コード例 #6
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
 public static IObservable <byte[]> PostAndGetBytes(string url, byte[] postData, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <byte[]>((observer, cancellation) => FetchBytes(new WWW(url, postData), observer, progress, cancellation)));
 }
コード例 #7
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
 public static IObservable <WWW> GetWWW(string url, Hash headers = null, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <WWW>((observer, cancellation) => Fetch(new WWW(url, null, (headers ?? new Hash())), observer, progress, cancellation)));
 }
コード例 #8
0
ファイル: ObservableWWW.cs プロジェクト: sufre/QFramework
 public static IObservable <AssetBundle> LoadFromCacheOrDownload(string url, Hash128 hash128, uint crc, IProgress <float> progress = null)
 {
     return(ObservableUnity.FromCoroutine <AssetBundle>((observer, cancellation) => FetchAssetBundle(WWW.LoadFromCacheOrDownload(url, hash128, crc), observer, progress, cancellation)));
 }