Exemple #1
0
        public static IObservable <string> Get(string url)
        {
            return(AnonymsousObservable.Create <string>(observer =>
            {
                void OnSuccess(string value)
                {
                    try
                    {
                        observer.OnNext(value);
                        observer.OnCompleted();
                    }
                    catch (Exception exception)
                    {
                        observer.OnError(exception);
                    }
                }

                void OnError(string error)
                {
                    observer.OnError(new Exception(error));
                }

                var e = GetWWW(url, OnSuccess, OnError);

                GameLoopDispatcher.StartCoroutine1(e);
                return Disposable.Empty;
            }));
        }
Exemple #2
0
 public IDisposable Schedule(Action action, TimeSpan dueTime)
 {
     GameLoopDispatcher.StartCoroutine1(DelayAction(action, dueTime));
     return(Disposable.Empty);
 }