public static IObservable <float> CreateObservable(
     EasingFunction easing,
     float duration,
     bool ignoreTimeScale)
 {
     return((IObservable <float>)Observable.CreateSafe <float>((Func <IObserver <M0>, IDisposable>)(observer =>
     {
         observer.OnNext(0.0f);
         BooleanDisposable cancellation = new BooleanDisposable();
         TweenEngine.AddTween((ITween) new ObservableEasing.ObservableTween(observer, cancellation, easing, duration, ignoreTimeScale));
         return (IDisposable)cancellation;
     }), false));
 }
예제 #2
0
            public static IObservable <float> CreateObservable(EasingFunction easing, float duration, bool ignoreTimeScale)
            {
                return(Observable.CreateSafe <float>(observer =>
                {
                    observer.OnNext(default(float)); // push initial value on subscribe.

                    var cancellation = new BooleanDisposable();
                    var tween = new ObservableTween(observer, cancellation, easing, duration, ignoreTimeScale);
                    TweenEngine.AddTween(tween);

                    return cancellation;
                }, false));
            }