コード例 #1
0
ファイル: Tween.cs プロジェクト: rtlsilva/silphid.unity
        public static ICompletable MoveBy(this Transform This, Vector3 delta, float duration, IEaser easer = null) =>
        Completable.Defer(() =>
        {
            var source = This.localPosition;
            var target = source + delta;

            return(Range(duration, easer)
                   .Lerp(source, target)
                   .Do(x => This.localPosition = x)
                   .AsCompletable());
        });
コード例 #2
0
 public static object Add(this ISequencer This, Func <ICompletable> completableFactory) =>
 This.Add(Completable.Defer(completableFactory));
コード例 #3
0
 protected static ICompletable GetCompletableFromItem(object item) =>
 item as ICompletable ??
 Completable.Defer((Func <ICompletable>)item);